diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2006-12-16 15:25:23 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2006-12-16 15:25:23 +0000 |
commit | c558afb137be65823b7866d443a8fb608cbba2ff (patch) | |
tree | 49620136bb759afd09b73a6b8ad20616edd30338 | |
parent | 1b3ef14df4e2729bcc4e24881038b7f75b08135c (diff) | |
download | gst-plugins-bad-c558afb137be65823b7866d443a8fb608cbba2ff.tar.gz gst-plugins-bad-c558afb137be65823b7866d443a8fb608cbba2ff.tar.bz2 gst-plugins-bad-c558afb137be65823b7866d443a8fb608cbba2ff.zip |
gst/qtdemux/qtdemux.c: We don't support seeking in streaming mode, so don't even try.
Original commit message from CVS:
* gst/qtdemux/qtdemux.c: (gst_qtdemux_get_src_query_types),
(gst_qtdemux_handle_src_query), (gst_qtdemux_handle_src_event):
We don't support seeking in streaming mode, so don't even try.
Implement seeking query so apps can query seekability properly
(see #365414). Fix duration query.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gst/qtdemux/qtdemux.c | 40 |
2 files changed, 41 insertions, 7 deletions
@@ -1,3 +1,11 @@ +2006-12-16 Tim-Philipp Müller <tim at centricular dot net> + + * gst/qtdemux/qtdemux.c: (gst_qtdemux_get_src_query_types), + (gst_qtdemux_handle_src_query), (gst_qtdemux_handle_src_event): + We don't support seeking in streaming mode, so don't even try. + Implement seeking query so apps can query seekability properly + (see #365414). Fix duration query. + 2006-12-15 Thomas Vander Stichele <thomas at apestaart dot org> * Makefile.am: diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 21e7a3f2..7c3864fe 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -551,6 +551,7 @@ gst_qtdemux_get_src_query_types (GstPad * pad) static const GstQueryType src_types[] = { GST_QUERY_POSITION, GST_QUERY_DURATION, + GST_QUERY_SEEKING, 0 }; @@ -587,17 +588,37 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstQuery * query) res = TRUE; } break; - case GST_QUERY_DURATION: - { - gint64 duration; + case GST_QUERY_DURATION:{ + GstFormat fmt; - res = gst_qtdemux_get_duration (qtdemux, &duration); + gst_query_parse_duration (query, &fmt, NULL); + if (fmt == GST_FORMAT_TIME) { + gint64 duration = -1; - gst_query_set_duration (query, GST_FORMAT_TIME, duration); + gst_qtdemux_get_duration (qtdemux, &duration); + if (duration > 0) { + gst_query_set_duration (query, GST_FORMAT_TIME, duration); + res = TRUE; + } + } + break; } + case GST_QUERY_SEEKING:{ + GstFormat fmt; + + gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL); + if (fmt == GST_FORMAT_TIME) { + gint64 duration = -1; + + gst_qtdemux_get_duration (qtdemux, &duration); + gst_query_set_seeking (query, GST_FORMAT_TIME, qtdemux->pullbased, + 0, duration); + res = TRUE; + } break; + } default: - res = FALSE; + res = gst_pad_query_default (pad, query); break; } @@ -971,7 +992,12 @@ gst_qtdemux_handle_src_event (GstPad * pad, GstEvent * event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: - res = gst_qtdemux_do_seek (qtdemux, pad, event); + if (qtdemux->pullbased) { + res = gst_qtdemux_do_seek (qtdemux, pad, event); + } else { + GST_DEBUG_OBJECT (qtdemux, "cannot seek in streaming mode"); + res = FALSE; + } break; default: res = FALSE; |