summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-01-25 01:01:38 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-01-25 01:01:38 +0000
commit12616f93313e4ee562b5d774df2cd77f2c1b955b (patch)
tree7f7afcc501390b18bf66b11885ba35e7c82d7d73 /src/xine-engine
parentd3f318eec71d38ce34f590daef0fed1f6cbf2eae (diff)
parent6c456a0d597c2a96aadee33c7af5845de279e478 (diff)
downloadxine-lib-12616f93313e4ee562b5d774df2cd77f2c1b955b.tar.gz
xine-lib-12616f93313e4ee562b5d774df2cd77f2c1b955b.tar.bz2
Merge from 1.1.
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/audio_out.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 5162c1883..855051582 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -291,6 +291,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) {
@@ -1614,13 +1615,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);
+ else
+ fifo_wait_empty(this->out_fifo);
}
pthread_mutex_lock( &this->driver_lock );