diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-07-23 11:50:16 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-07-23 11:51:07 +0200 |
commit | aa02444768d8524fd6f70c84c87c3a269fb17c40 (patch) | |
tree | 9a7535ba710bd3e531e2a34d8976214a1fd257c3 /gst | |
parent | 375976c847b80ab40ff30e1e5cef91ff12bddf50 (diff) |
flvdemux: Implement SEEKING query
Also add some more query types to the answer of the query type function.
Fixes bug #589424.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/flv/gstflvdemux.c | 26 | ||||
-rw-r--r-- | gst/flv/gstflvparse.c | 2 |
2 files changed, 28 insertions, 0 deletions
diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index 4f54ec6a..59a12d03 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -1077,6 +1077,32 @@ gst_flv_demux_query (GstPad * pad, GstQuery * query) break; } + case GST_QUERY_SEEKING:{ + GstFormat fmt; + + gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL); + res = TRUE; + if (fmt != GST_FORMAT_TIME || !demux->index) { + gst_query_set_seeking (query, fmt, FALSE, -1, -1); + } else if (demux->random_access) { + gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, + demux->duration); + } else { + GstQuery *peerquery = gst_query_new_seeking (GST_FORMAT_BYTES); + gboolean seekable = gst_pad_peer_query (demux->sinkpad, peerquery); + + if (seekable) + gst_query_parse_seeking (peerquery, NULL, &seekable, NULL, NULL); + gst_query_unref (peerquery); + + if (seekable) + gst_query_set_seeking (query, GST_FORMAT_TIME, seekable, 0, + demux->duration); + else + gst_query_set_seeking (query, GST_FORMAT_TIME, FALSE, -1, -1); + } + break; + } case GST_QUERY_LATENCY: default: { diff --git a/gst/flv/gstflvparse.c b/gst/flv/gstflvparse.c index 747ab080..804da502 100644 --- a/gst/flv/gstflvparse.c +++ b/gst/flv/gstflvparse.c @@ -65,6 +65,8 @@ gst_flv_demux_query_types (GstPad * pad) { static const GstQueryType query_types[] = { GST_QUERY_DURATION, + GST_QUERY_POSITION, + GST_QUERY_SEEKING, 0 }; |