baseaudiosink: fix a small glitch after pause
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 8 Apr 2009 16:04:22 +0000 (18:04 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 8 Apr 2009 16:06:54 +0000 (18:06 +0200)
After we pause the stream and interrupt the writeout to the ringbuffer, also adjust
the amount of output samples we consumed. We can't do this reliably with the
current API when we are doing trick modes but we can do the right thing for
normal playback.

gst-libs/gst/audio/gstbaseaudiosink.c

index 59318ab5465d50b601508f035932d3245efb858a..5e7c14eb30d24deedbc807e1ea2d3d6e469d10b7 100644 (file)
@@ -1495,6 +1495,13 @@ no_sync:
      * be aligned to this one */
     align_next = FALSE;
 
+    /* update the output samples. FIXME, this will just skip them when pausing
+     * during trick mode */
+    if (out_samples > written)
+      out_samples -= written;
+    else
+      break;
+
     samples -= written;
     data += written * bps;
   } while (TRUE);