when the stream is paused fifo_wait_empty will wait forever. In that case we
discard all buffers before calling fifo_wait_empty
1.1 --- a/src/xine-engine/audio_out.c Tue Nov 06 14:07:47 2007 +0000
1.2 +++ b/src/xine-engine/audio_out.c Thu Nov 15 15:27:15 2007 +0100
1.3 @@ -290,6 +290,7 @@
1.4 int num_buffers;
1.5 };
1.6
1.7 +static int ao_set_property (xine_audio_port_t *this_gen, int property, int value);
1.8
1.9 static audio_fifo_t *fifo_new (xine_t *xine) {
1.10
1.11 @@ -1599,6 +1600,11 @@
1.12 xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_out: no streams left, closing driver\n");
1.13
1.14 if (this->audio_loop_running) {
1.15 + if (this->clock->speed == XINE_SPEED_PAUSE ||
1.16 + (this->clock->speed != XINE_FINE_SPEED_NORMAL && !this->slow_fast_audio)) {
1.17 + /* discard buffers, otherwise we'll wait forever */
1.18 + ao_set_property(this_gen, AO_PROP_DISCARD_BUFFERS, 1);
1.19 + }
1.20 /* make sure there are no more buffers on queue */
1.21 fifo_wait_empty(this->out_fifo);
1.22 }