All pastes #773794 Raw Edit

Mine

public text v1 · immutable
·published 2007-11-14 20:01 UTC
rendered paste body
diff -r 662130d9dad0 src/xine-engine/audio_out.c
--- a/src/xine-engine/audio_out.c       Tue Nov 06 14:07:47 2007 +0000
+++ b/src/xine-engine/audio_out.c       Wed Nov 14 21:00:58 2007 +0100
@@ -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 *
     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);
     }