ext/mad/gstmad.c: When handling seeks, don't convert -1 start or stop values to a...
authorJan Schmidt <thaytan@mad.scientist.com>
Mon, 12 Mar 2007 17:26:13 +0000 (17:26 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Mon, 12 Mar 2007 17:26:13 +0000 (17:26 +0000)
Original commit message from CVS:
* ext/mad/gstmad.c: (gst_mad_convert_sink), (gst_mad_convert_src):
When handling seeks, don't convert -1 start or stop values to a bogus
byte position - pass them upstream as -1.

ChangeLog
ext/mad/gstmad.c

index ea11e51..c763907 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-03-12  Jan Schmidt  <thaytan@mad.scientist.com>
 
+       * ext/mad/gstmad.c: (gst_mad_convert_sink), (gst_mad_convert_src):
+       When handling seeks, don't convert -1 start or stop values to a bogus
+       byte position - pass them upstream as -1.
+
+2007-03-12  Jan Schmidt  <thaytan@mad.scientist.com>
+
        * gst/mpegaudioparse/gstmpegaudioparse.c:
        (mp3_type_frame_length_from_header), (gst_mp3parse_reset),
        (gst_mp3parse_init), (gst_mp3parse_sink_event),
index 5201ad2..571e904 100644 (file)
@@ -396,6 +396,12 @@ gst_mad_convert_sink (GstPad * pad, GstFormat src_format, gint64 src_value,
     return TRUE;
   }
 
+  /* -1 always maps to -1, and 0 to 0, we don't need any more info for that */
+  if (src_value == -1 || src_value == 0) {
+    *dest_value = src_value;
+    return TRUE;
+  }
+
   mad = GST_MAD (GST_PAD_PARENT (pad));
 
   if (mad->vbr_average == 0)
@@ -444,6 +450,12 @@ gst_mad_convert_src (GstPad * pad, GstFormat src_format, gint64 src_value,
     return TRUE;
   }
 
+  /* -1 always maps to -1, and 0 to 0, we don't need any more info for that */
+  if (src_value == -1 || src_value == 0) {
+    *dest_value = src_value;
+    return TRUE;
+  }
+
   mad = GST_MAD (GST_PAD_PARENT (pad));
 
   bytes_per_sample = MAD_NCHANNELS (&mad->frame.header) * 4;