From 0e18b6abbcbd9087676e4ef40e392669845c06c0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 27 Dec 2002 22:43:28 +0000 Subject: [PATCH] prefer seeking on time Original commit message from CVS: prefer seeking on time --- gst/mpegstream/gstmpegdemux.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gst/mpegstream/gstmpegdemux.c b/gst/mpegstream/gstmpegdemux.c index 1eac419d2c..63782374a2 100644 --- a/gst/mpegstream/gstmpegdemux.c +++ b/gst/mpegstream/gstmpegdemux.c @@ -140,11 +140,12 @@ static void gst_mpeg_demux_send_data (GstMPEGParse *mpeg_parse, static void gst_mpeg_demux_handle_discont (GstMPEGParse *mpeg_parse); static gboolean gst_mpeg_demux_handle_src_event (GstPad *pad, GstEvent *event); +const GstFormat* gst_mpeg_demux_get_src_formats (GstPad *pad); static void gst_mpeg_demux_set_index (GstElement *element, GstIndex *index); static GstIndex* gst_mpeg_demux_get_index (GstElement *element); static GstElementStateReturn - gst_mpeg_demux_change_state (GstElement *element); + gst_mpeg_demux_change_state (GstElement *element); static GstMPEGParseClass *parent_class = NULL; /*static guint gst_mpeg_demux_signals[LAST_SIGNAL] = { 0 };*/ @@ -421,7 +422,7 @@ gst_mpeg_demux_parse_syshead (GstMPEGParse *mpeg_parse, GstBuffer *buffer) *outpad = gst_pad_new_from_template (newtemp, name); gst_pad_try_set_caps (*outpad, gst_pad_get_pad_template_caps (*outpad)); - gst_pad_set_formats_function (*outpad, gst_mpeg_parse_get_src_formats); + gst_pad_set_formats_function (*outpad, gst_mpeg_demux_get_src_formats); gst_pad_set_convert_function (*outpad, gst_mpeg_parse_convert_src); gst_pad_set_event_mask_function (*outpad, gst_mpeg_parse_get_src_event_masks); gst_pad_set_event_function (*outpad, gst_mpeg_demux_handle_src_event); @@ -859,7 +860,7 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer) *outpad = gst_pad_new_from_template (newtemp, name); gst_pad_try_set_caps (*outpad, gst_pad_get_pad_template_caps (*outpad)); - gst_pad_set_formats_function (*outpad, gst_mpeg_parse_get_src_formats); + gst_pad_set_formats_function (*outpad, gst_mpeg_demux_get_src_formats); gst_pad_set_convert_function (*outpad, gst_mpeg_parse_convert_src); gst_pad_set_event_mask_function (*outpad, gst_mpeg_parse_get_src_event_masks); gst_pad_set_event_function (*outpad, gst_mpeg_demux_handle_src_event); @@ -919,6 +920,17 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer) return TRUE; } +const GstFormat* +gst_mpeg_demux_get_src_formats (GstPad *pad) +{ + static const GstFormat formats[] = { + GST_FORMAT_TIME, /* we prefer seeking on time */ + GST_FORMAT_BYTES, + 0 + }; + return formats; +} + static gboolean index_seek (GstPad *pad, GstEvent *event, gint64 *offset) {