From b3bed8b0dabd1cd2919e674f3fe24c11748fa52c Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 12 Mar 2007 17:26:13 +0000 Subject: [PATCH] ext/mad/gstmad.c: When handling seeks, don't convert -1 start or stop values to a bogus byte position - pass them ups... 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 | 6 ++++++ ext/mad/gstmad.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index ea11e51..c763907 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-03-12 Jan Schmidt + * 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 + * gst/mpegaudioparse/gstmpegaudioparse.c: (mp3_type_frame_length_from_header), (gst_mp3parse_reset), (gst_mp3parse_init), (gst_mp3parse_sink_event), diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index 5201ad2..571e904 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -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; -- 2.7.4