gst/mpegaudioparse/gstmpegaudioparse.c: Fix a calculation that was causing mp3parse...
authorJan Schmidt <thaytan@mad.scientist.com>
Sun, 15 Jul 2007 19:39:46 +0000 (19:39 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Sun, 15 Jul 2007 19:39:46 +0000 (19:39 +0000)
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Fix a calculation that was causing mp3parse to drop every incoming
frame when upstream delivered a segment in TIME format, breaking
playback of all mpeg system streams.

ChangeLog
common
gst/mpegaudioparse/gstmpegaudioparse.c

index 725d421..109316e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-07-15  Jan Schmidt  <thaytan@noraisin.net>
+
+       * gst/mpegaudioparse/gstmpegaudioparse.c:
+       (gst_mp3parse_emit_frame):
+       Fix a calculation that was causing mp3parse to drop every incoming
+       frame when upstream delivered a segment in TIME format, breaking 
+       playback of all mpeg system streams.
+
 2007-07-13  Jan Schmidt  <thaytan@mad.scientist.com>
 
        * Makefile.am:
diff --git a/common b/common
index 5167bce..fb4b30e 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 5167bced491ffe62251c62d6c5e7b9a7541e97e5
+Subproject commit fb4b30ebbec59a8944cacae5fb5cf40bff5dfcaa
index 9165276..ef55b11 100644 (file)
@@ -582,7 +582,7 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size)
   if (mp3parse->segment.start == 0) {
     push_start = 0;
   } else if (GST_CLOCK_TIME_IS_VALID (mp3parse->max_bitreservoir)) {
-    if (mp3parse->segment.start - mp3parse->max_bitreservoir >= 0)
+    if (mp3parse->segment.start > mp3parse->max_bitreservoir)
       push_start = mp3parse->segment.start - mp3parse->max_bitreservoir;
     else
       push_start = 0;
@@ -590,14 +590,16 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size)
     push_start = mp3parse->segment.start;
   }
 
-  if (G_UNLIKELY ((GST_CLOCK_TIME_IS_VALID (mp3parse->segment.start) &&
+  if (G_UNLIKELY ((GST_CLOCK_TIME_IS_VALID (push_start) &&
               GST_BUFFER_TIMESTAMP (outbuf) + GST_BUFFER_DURATION (outbuf)
               < push_start)
           || (GST_CLOCK_TIME_IS_VALID (mp3parse->segment.stop)
               && GST_BUFFER_TIMESTAMP (outbuf) >= mp3parse->segment.stop))) {
     GST_DEBUG_OBJECT (mp3parse,
-        "Buffer outside of configured segment, dropping, timestamp %"
+        "Buffer outside of configured segment range %" GST_TIME_FORMAT
+        " to %" GST_TIME_FORMAT ", dropping, timestamp %"
         GST_TIME_FORMAT ", offset 0x%08" G_GINT64_MODIFIER "x",
+        GST_TIME_ARGS (push_start), GST_TIME_ARGS (mp3parse->segment.stop),
         GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
         GST_BUFFER_OFFSET (outbuf));
     gst_buffer_unref (outbuf);