Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
75567279
Commit
75567279
authored
Nov 17, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sndio: remove fake pause() implementation
parent
2a0c18e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
33 deletions
+9
-33
modules/audio_output/sndio.c
modules/audio_output/sndio.c
+9
-33
No files found.
modules/audio_output/sndio.c
View file @
75567279
...
...
@@ -45,7 +45,6 @@ vlc_module_end ()
static
int
TimeGet
(
audio_output
,
mtime_t
*
);
static
void
Play
(
audio_output_t
*
,
block_t
*
);
static
void
Pause
(
audio_output_t
*
,
bool
,
mtime_t
);
static
void
Flush
(
audio_output_t
*
,
bool
);
static
int
VolumeSet
(
audio_output_t
*
,
float
);
static
int
MuteSet
(
audio_output_t
*
,
bool
);
...
...
@@ -60,7 +59,6 @@ struct aout_sys_t
unsigned
rate
;
unsigned
volume
;
bool
mute
;
bool
paused
;
};
/** Initializes an sndio playback stream */
...
...
@@ -159,7 +157,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
aout
->
sys
=
sys
;
aout
->
time_get
=
TimeGet
;
aout
->
play
=
Play
;
aout
->
pause
=
Pause
;
aout
->
pause
=
NULL
;
aout
->
flush
=
Flush
;
if
(
sio_onvol
(
sys
->
hdl
,
VolumeChanged
,
aout
))
{
...
...
@@ -174,7 +172,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
sys
->
read_offset
=
0
;
sys
->
write_offset
=
0
;
sys
->
paused
=
false
;
sio_onmove
(
sys
->
hdl
,
PositionChanged
,
aout
);
sio_start
(
sys
->
hdl
);
return
VLC_SUCCESS
;
...
...
@@ -229,42 +226,21 @@ static void Play (audio_output_t *aout, block_t *block)
block_Release
(
block
);
}
static
void
Pause
(
audio_output_t
*
aout
,
bool
pause
,
mtime_t
date
)
{
aout_sys_t
*
sys
=
aout
->
sys
;
if
(
pause
)
sio_stop
(
sys
->
hdl
);
else
{
sys
->
read_offset
=
0
;
sys
->
write_offset
=
0
;
sio_start
(
sys
->
hdl
);
}
sys
->
paused
=
pause
;
(
void
)
date
;
}
static
void
Drain
(
audio_output_t
*
aout
)
{
long
long
frames
=
sys
->
write_offset
-
sys
->
read_offset
;
if
(
frames
>
0
)
msleep
(
frames
*
CLOCK_FREQ
/
sys
->
rate
);
}
static
void
Flush
(
audio_output_t
*
aout
,
bool
wait
)
{
if
(
wait
)
{
Drain
(
aout
);
long
long
frames
=
sys
->
write_offset
-
sys
->
read_offset
;
if
(
frames
>
0
)
msleep
(
frames
*
CLOCK_FREQ
/
sys
->
rate
);
}
else
{
if
(
sys
->
paused
)
return
;
Pause
(
aout
,
true
)
;
Pause
(
aout
,
false
);
sio_stop
(
sys
->
hdl
);
sys
->
read_offset
=
0
;
sys
->
write_offset
=
0
;
sio_start
(
sys
->
hdl
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment