From: Mark Nauwelaerts Date: Fri, 14 Jan 2011 14:26:37 +0000 (+0100) Subject: baesparse: fix refactor regression in loop based parsing X-Git-Tag: RELEASE-0.10.33~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb4ec7388ab7c95157687e9eee5e394dab3c29d1;p=platform%2Fupstream%2Fgstreamer.git baesparse: fix refactor regression in loop based parsing --- diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index c949316..63ac08d 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -2236,9 +2236,15 @@ gst_base_parse_scan_frame (GstBaseParse * parse, GstBaseParseClass * klass, } } - if (fsize <= GST_BUFFER_SIZE (buffer)) { - outbuf = gst_buffer_create_sub (buffer, 0, fsize); - GST_BUFFER_OFFSET (outbuf) = GST_BUFFER_OFFSET (buffer); + /* Does the subclass want to skip too? */ + if (skip > 0) + parse->priv->offset += skip; + else if (skip < 0) + skip = 0; + + if (fsize + skip <= GST_BUFFER_SIZE (buffer)) { + outbuf = gst_buffer_create_sub (buffer, skip, fsize); + GST_BUFFER_OFFSET (outbuf) = GST_BUFFER_OFFSET (buffer) + skip; GST_BUFFER_TIMESTAMP (outbuf) = GST_CLOCK_TIME_NONE; gst_buffer_unref (buffer); } else { @@ -2254,10 +2260,6 @@ gst_base_parse_scan_frame (GstBaseParse * parse, GstBaseParseClass * klass, parse->priv->offset += fsize; - /* Does the subclass want to skip too? */ - if (skip > 0) - parse->priv->offset += skip; - *buf = outbuf; done: