Commit b7e4ff66 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

ext/ffmpeg/gstffmpegdemux.c: Implement SEEKING query, so players such as totem...

ext/ffmpeg/gstffmpegdemux.c: Implement SEEKING query, so players such as totem can query seekability. Fix a comment t...

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_query_list),
(gst_ffmpegdemux_src_query), (gst_ffmpegdemux_get_stream),
(gst_ffmpegdemux_open):
Implement SEEKING query, so players such as totem can query
seekability. Fix a comment typo or two.
parent da3342ef
2008-05-25 Tim-Philipp Müller <tim.muller at collabora co uk>
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_query_list),
(gst_ffmpegdemux_src_query), (gst_ffmpegdemux_get_stream),
(gst_ffmpegdemux_open):
Implement SEEKING query, so players such as totem can query
seekability. Fix a comment typo or two.
2008-05-25 Jan Schmidt <jan.schmidt@sun.com>
* configure.ac:
......
......@@ -613,6 +613,7 @@ gst_ffmpegdemux_src_query_list (GstPad * pad)
static const GstQueryType src_types[] = {
GST_QUERY_DURATION,
GST_QUERY_POSITION,
GST_QUERY_SEEKING,
0
};
......@@ -736,6 +737,22 @@ gst_ffmpegdemux_src_query (GstPad * pad, GstQuery * query)
}
}
break;
case GST_QUERY_SEEKING: {
GstFormat format;
gboolean seekable;
gint64 dur = -1;
gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
seekable = demux->seekable;
if (!gst_pad_query_duration (pad, &format, &dur)) {
/* unlikely that we don't know duration but can seek */
seekable = FALSE;
dur = -1;
}
gst_query_set_seeking (query, format, seekable, 0, dur);
res = TRUE;
break;
}
default:
/* FIXME : ADD GST_QUERY_CONVERT */
res = gst_pad_query_default (pad, query);
......@@ -894,7 +911,7 @@ gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream)
stream->pad = pad;
gst_pad_set_element_private (pad, stream);
/* transform some usefull info to GstClockTime and remember */
/* transform some useful info to GstClockTime and remember */
{
GstClockTime tmp;
......@@ -1063,7 +1080,7 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux)
gst_message_new_tag (GST_OBJECT (demux), tags));
}
/* transform some usefull info to GstClockTime and remember */
/* transform some useful info to GstClockTime and remember */
demux->start_time = gst_util_uint64_scale_int (demux->context->start_time,
GST_SECOND, AV_TIME_BASE);
GST_DEBUG_OBJECT (demux, "start time: %" GST_TIME_FORMAT,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment