gst/base/gstbasesink.c: Don't sync on buffers that fall partially outside our current...
authorMichael Smith <msmith@xiph.org>
Fri, 11 Nov 2005 15:19:37 +0000 (15:19 +0000)
committerMichael Smith <msmith@xiph.org>
Fri, 11 Nov 2005 15:19:37 +0000 (15:19 +0000)
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_do_sync):
Don't sync on buffers that fall partially outside our current
segment. Prevents an assertion failure/abort playing some files.

ChangeLog
gst/base/gstbasesink.c
libs/gst/base/gstbasesink.c

index 4ed2e13..371201a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-11-11  Michael Smith <msmith@fluendo.com>
+
+       * gst/base/gstbasesink.c: (gst_base_sink_do_sync):
+         Don't sync on buffers that fall partially outside our current
+         segment. Prevents an assertion failure/abort playing some files.
+
 2005-11-10  Andy Wingo  <wingo@pobox.com>
 
        * check/gst/gstbin.c (test_message_state_changed_children): Style
index 3cd2735..7c9c2da 100644 (file)
@@ -1047,11 +1047,17 @@ gst_base_sink_do_sync (GstBaseSink * basesink, GstBuffer * buffer)
 
     stream_start = (gint64) start - basesink->segment_start;
     stream_end = (gint64) end - basesink->segment_start;
+
+    if (stream_start < 0) {
+      GST_DEBUG_OBJECT (basesink, "stream_start negative, invalid");
+      goto done;
+    }
   } else {
     stream_start = (gint64) start;
     stream_end = (gint64) end;
   }
 
+
   /* correct for rate */
   if (basesink->segment_rate != 0.0) {
     stream_start /= ABS (basesink->segment_rate);
index 3cd2735..7c9c2da 100644 (file)
@@ -1047,11 +1047,17 @@ gst_base_sink_do_sync (GstBaseSink * basesink, GstBuffer * buffer)
 
     stream_start = (gint64) start - basesink->segment_start;
     stream_end = (gint64) end - basesink->segment_start;
+
+    if (stream_start < 0) {
+      GST_DEBUG_OBJECT (basesink, "stream_start negative, invalid");
+      goto done;
+    }
   } else {
     stream_start = (gint64) start;
     stream_end = (gint64) end;
   }
 
+
   /* correct for rate */
   if (basesink->segment_rate != 0.0) {
     stream_start /= ABS (basesink->segment_rate);