diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-12-21 18:18:39 +0100 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2010-01-05 17:45:48 +0100 |
commit | 3f5b4ee67f02fb648033c3a545b7a9f91c2c5faa (patch) | |
tree | 030f9ca07c7a9c72150adf962178a3de54d3beec /gst/audioparsers | |
parent | a885f80fd3d000af14ba310355093a2a4e98f1e7 (diff) | |
download | gstreamer-plugins-bad-3f5b4ee67f02fb648033c3a545b7a9f91c2c5faa.tar.gz |
baseparse: adjust seek handling and newsegment sending
Perform sanity check on type of seek, and only perform one that is
appropriately supported. Adjust downstream newsegment event
to first buffer timestamp that is sent downstream.
Diffstat (limited to 'gst/audioparsers')
-rw-r--r-- | gst/audioparsers/gstbaseparse.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index 8e2a2ae2a..3fa8ea8fa 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -976,6 +976,19 @@ gst_base_parse_push_buffer (GstBaseParse * parse, GstBuffer * buffer) gst_buffer_set_caps (buffer, GST_PAD_CAPS (parse->srcpad)); + /* segment times are typically estimates, + * actual frame data might lead subclass to different timestamps, + * so override segment start from what is supplied there */ + if (G_UNLIKELY (parse->pending_segment && !parse->priv->passthrough && + GST_CLOCK_TIME_IS_VALID (last_stop))) { + gst_event_unref (parse->pending_segment); + /* stop time possibly lost this way, + * but unlikely and not really supported */ + parse->pending_segment = + gst_event_new_new_segment (FALSE, parse->segment.rate, + parse->segment.format, last_stop, -1, last_stop); + } + /* and should then also be linked downstream, so safe to send some events */ if (parse->priv->pad_mode == GST_ACTIVATE_PULL) { if (G_UNLIKELY (parse->close_segment)) { @@ -1955,6 +1968,12 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) } } + /* to much estimating going on to support this sensibly, + * and no eos/end-of-segment loop handling either ... */ + if (stop_type != GST_SEEK_TYPE_NONE || (flags & GST_SEEK_FLAG_SEGMENT)) + goto wrong_type; + stop = -1; + /* get flush flag */ flush = flags & GST_SEEK_FLAG_FLUSH; |