Commit c1b2242e authored by Stefan Kost's avatar Stefan Kost
Browse files

gst/avi/gstavidemux.c: Implement seek-query.

Original commit message from CVS:
* gst/avi/gstavidemux.c:
Implement seek-query.
parent 14e218c0
2007-09-03 Stefan Kost <ensonic@users.sf.net>
* gst/avi/gstavidemux.c:
Implement seek-query.
2007-08-29 Wim Taymans <wim.taymans@gmail.com>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_stream_configure_udp_sink),
......
......@@ -453,6 +453,7 @@ gst_avi_demux_get_src_query_types (GstPad * pad)
static const GstQueryType src_types[] = {
GST_QUERY_POSITION,
GST_QUERY_DURATION,
GST_QUERY_SEEKING,
0
};
......@@ -537,6 +538,31 @@ gst_avi_demux_handle_src_query (GstPad * pad, GstQuery * query)
gst_query_set_duration (query, GST_FORMAT_TIME, stream->duration);
break;
}
case GST_QUERY_SEEKING:{
GstFormat fmt;
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
if (fmt == GST_FORMAT_TIME) {
gboolean seekable = TRUE;
if (avi->streaming) {
seekable = FALSE;
} else {
if (avi->index_entries == NULL) {
seekable = FALSE;
/* FIXME: when building index_entried, count keyframes
if (!(avi->key_frame_ct > 1))
seekable = FALSE;
*/
}
}
gst_query_set_seeking (query, GST_FORMAT_TIME, seekable,
0, stream->duration);
res = TRUE;
}
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
......
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