diff options
Diffstat (limited to 'src/xine-engine/audio_out.c')
-rw-r--r-- | src/xine-engine/audio_out.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index aac1739aa..855051582 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -89,11 +89,11 @@ #define LOG_RESAMPLE_SYNC 0 -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" -#include "resample.h" -#include "metronom.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/audio_out.h> +#include <xine/resample.h> +#include <xine/metronom.h> #define NUM_AUDIO_BUFFERS 32 @@ -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 ); @@ -2045,8 +2050,8 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int i, err; pthread_attr_t pth_attrs; pthread_mutexattr_t attr; - static const char* resample_modes[] = {"auto", "off", "on", NULL}; - static const char* av_sync_methods[] = {"metronom feedback", "resample", NULL}; + static const char *const resample_modes[] = {"auto", "off", "on", NULL}; + static const char *const av_sync_methods[] = {"metronom feedback", "resample", NULL}; this = xine_xmalloc (sizeof (aos_t)) ; |