diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-01-24 23:38:09 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-01-24 23:38:09 +0000 |
commit | b24d41f54d441f518c68c120b8ee1a2673bfbe0d (patch) | |
tree | a01e3aa931381378c7e1e197f14ccdfe8ffa9841 | |
parent | e2dd04a9d3cd3549a409c50107810242d5320fac (diff) | |
download | xine-lib-b24d41f54d441f518c68c120b8ee1a2673bfbe0d.tar.gz xine-lib-b24d41f54d441f518c68c120b8ee1a2673bfbe0d.tar.bz2 |
Only restore the audio buffer discard setting if it was altered.
(Cset 1a0447486a13 broke things differently.)
-rw-r--r-- | src/xine-engine/audio_out.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index e9bda70fb..4dcdb5af0 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -287,6 +287,7 @@ struct audio_fifo_s { int num_buffers; }; +static int ao_get_property (xine_audio_port_t *this_gen, int property); static int ao_set_property (xine_audio_port_t *this_gen, int property, int value); static audio_fifo_t *fifo_new (xine_t *xine) { @@ -1612,14 +1613,17 @@ static void ao_close(xine_audio_port_t *this_gen, xine_stream_t *stream) { xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_out: no streams left, closing driver\n"); if (this->audio_loop_running) { + /* make sure there are no more buffers on queue */ if (this->clock->speed == XINE_SPEED_PAUSE || (this->clock->speed != XINE_FINE_SPEED_NORMAL && !this->slow_fast_audio)) { - /* discard buffers, otherwise we'll wait forever */ + int discard = ao_get_property(this_gen, AO_PROP_DISCARD_BUFFERS); + /* discard buffers while waiting, otherwise we'll wait forever */ ao_set_property(this_gen, AO_PROP_DISCARD_BUFFERS, 1); + fifo_wait_empty(this->out_fifo); + ao_set_property(this_gen, AO_PROP_DISCARD_BUFFERS, discard); } - /* make sure there are no more buffers on queue */ - fifo_wait_empty(this->out_fifo); - ao_set_property(this_gen, AO_PROP_DISCARD_BUFFERS, 0); + else + fifo_wait_empty(this->out_fifo); } pthread_mutex_lock( &this->driver_lock ); |