mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
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.
This commit is contained in:
parent
1b3ef14df4
commit
c558afb137
2 changed files with 42 additions and 8 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:
|
||||
|
|
|
@ -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_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:
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue