summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Kretz <kretz@kde.org>2007-11-15 15:27:15 +0100
committerMatthias Kretz <kretz@kde.org>2007-11-15 15:27:15 +0100
commit443fcac477f3844b4e2dcd867f7e8818b83978a7 (patch)
tree70e44950d4da1b9abad3c5deb0a0a453a36b75c2
parent81b2bbc48c154adefd51b49cd09fdc97fdf9f1a1 (diff)
downloadxine-lib-443fcac477f3844b4e2dcd867f7e8818b83978a7.tar.gz
xine-lib-443fcac477f3844b4e2dcd867f7e8818b83978a7.tar.bz2
when the stream is paused fifo_wait_empty will wait forever. In that case we
discard all buffers before calling fifo_wait_empty
-rw-r--r--src/xine-engine/audio_out.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index fb2f495d5..1f54786fc 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -290,6 +290,7 @@ struct audio_fifo_s {
int num_buffers;
};
+static int ao_set_property (xine_audio_port_t *this_gen, int property, int value);
static audio_fifo_t *fifo_new (xine_t *xine) {
@@ -1599,6 +1600,11 @@ 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) {
+ 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 */
+ ao_set_property(this_gen, AO_PROP_DISCARD_BUFFERS, 1);
+ }
/* make sure there are no more buffers on queue */
fifo_wait_empty(this->out_fifo);
}