From: <mn...@ke...> - 2011-01-28 11:51:45
|
Module: gst-plugins-bad Branch: master Commit: 16342223ee699a471ff0c39407f7ca4bb8cddcf1 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=16342223ee699a471ff0c39407f7ca4bb8cddcf1 Author: Mark Nauwelaerts <mar...@co...> Date: Tue Jan 11 15:24:02 2011 +0100 baseparse: properly track upstream timestamps ... rather than with a delay. --- gst/audioparsers/gstbaseparse.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index a0319d8..ee62f10 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -2106,6 +2106,14 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer) break; } + /* move along with upstream timestamp (if any), + * but interpolate in between */ + timestamp = gst_adapter_prev_timestamp (parse->adapter, NULL); + if (GST_CLOCK_TIME_IS_VALID (timestamp) && + (parse->priv->prev_ts != timestamp)) { + parse->priv->prev_ts = parse->priv->next_ts = timestamp; + } + /* FIXME: Would it be more efficient to make a subbuffer instead? */ outbuf = gst_adapter_take_buffer (parse->adapter, fsize); outbuf = gst_buffer_make_metadata_writable (outbuf); @@ -2114,14 +2122,7 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer) GST_BUFFER_OFFSET (outbuf) = parse->priv->offset; parse->priv->offset += fsize; GST_BUFFER_TIMESTAMP (outbuf) = GST_CLOCK_TIME_NONE; - - /* move along with upstream timestamp (if any), - * but interpolate in between */ - timestamp = gst_adapter_prev_timestamp (parse->adapter, NULL); - if (GST_CLOCK_TIME_IS_VALID (timestamp) && - (parse->priv->prev_ts != timestamp)) { - parse->priv->prev_ts = parse->priv->next_ts = timestamp; - } + GST_BUFFER_DURATION (outbuf) = GST_CLOCK_TIME_NONE; frame->buffer = outbuf; ret = gst_base_parse_handle_and_push_frame (parse, bclass, frame); |