Commit 75567279 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

sndio: remove fake pause() implementation

parent 2a0c18e4
...@@ -45,7 +45,6 @@ vlc_module_end () ...@@ -45,7 +45,6 @@ vlc_module_end ()
static int TimeGet (audio_output, mtime_t *); static int TimeGet (audio_output, mtime_t *);
static void Play (audio_output_t *, block_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 void Flush (audio_output_t *, bool);
static int VolumeSet (audio_output_t *, float); static int VolumeSet (audio_output_t *, float);
static int MuteSet (audio_output_t *, bool); static int MuteSet (audio_output_t *, bool);
...@@ -60,7 +59,6 @@ struct aout_sys_t ...@@ -60,7 +59,6 @@ struct aout_sys_t
unsigned rate; unsigned rate;
unsigned volume; unsigned volume;
bool mute; bool mute;
bool paused;
}; };
/** Initializes an sndio playback stream */ /** Initializes an sndio playback stream */
...@@ -159,7 +157,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -159,7 +157,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
aout->sys = sys; aout->sys = sys;
aout->time_get = TimeGet; aout->time_get = TimeGet;
aout->play = Play; aout->play = Play;
aout->pause = Pause; aout->pause = NULL;
aout->flush = Flush; aout->flush = Flush;
if (sio_onvol(sys->hdl, VolumeChanged, aout)) if (sio_onvol(sys->hdl, VolumeChanged, aout))
{ {
...@@ -174,7 +172,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -174,7 +172,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
sys->read_offset = 0; sys->read_offset = 0;
sys->write_offset = 0; sys->write_offset = 0;
sys->paused = false;
sio_onmove (sys->hdl, PositionChanged, aout); sio_onmove (sys->hdl, PositionChanged, aout);
sio_start (sys->hdl); sio_start (sys->hdl);
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -229,42 +226,21 @@ static void Play (audio_output_t *aout, block_t *block) ...@@ -229,42 +226,21 @@ static void Play (audio_output_t *aout, block_t *block)
block_Release (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) static void Flush (audio_output_t *aout, bool wait)
{ {
if (wait) if (wait)
{ {
Drain (aout); long long frames = sys->write_offset - sys->read_offset;
if (frames > 0)
msleep (frames * CLOCK_FREQ / sys->rate);
} }
else else
{ {
if (sys->paused) sio_stop (sys->hdl);
return; sys->read_offset = 0;
Pause (aout, true); sys->write_offset = 0;
Pause (aout, false); sio_start (sys->hdl);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment