From ba7ee6ae6cc73b5620b517e03ddac8a2b4badb90 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 19 Oct 2005 15:57:04 +0000 Subject: API change fix. Original commit message from CVS: * ext/dv/gstdvdemux.c: (gst_dvdemux_get_src_query_types), (gst_dvdemux_src_query): * ext/flac/gstflacdec.c: (gst_flacdec_length), (gst_flacdec_src_query): * ext/raw1394/gstdv1394src.c: (gst_dv1394src_query): * ext/speex/gstspeexdec.c: (speex_dec_src_query): * gst/avi/gstavidemux.c: (gst_avi_demux_handle_src_query): * gst/debug/gstnavseek.c: (gst_navseek_seek): * gst/debug/progressreport.c: (gst_progress_report_report): * gst/matroska/ebml-read.c: (gst_ebml_read_get_length): * gst/matroska/matroska-demux.c: (gst_matroska_demux_handle_src_query): * gst/matroska/matroska-mux.c: (gst_matroska_mux_start): * gst/wavparse/gstwavparse.c: (gst_wavparse_handle_seek), (gst_wavparse_stream_headers), (gst_wavparse_stream_data), (gst_wavparse_pad_convert), (gst_wavparse_pad_query), (gst_wavparse_srcpad_event): API change fix. --- ext/dv/gstdvdemux.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'ext/dv') diff --git a/ext/dv/gstdvdemux.c b/ext/dv/gstdvdemux.c index d6fefe5e..9e6e2055 100644 --- a/ext/dv/gstdvdemux.c +++ b/ext/dv/gstdvdemux.c @@ -413,6 +413,7 @@ gst_dvdemux_get_src_query_types (GstPad * pad) { static const GstQueryType src_query_types[] = { GST_QUERY_POSITION, + GST_QUERY_DURATION, GST_QUERY_CONVERT, 0 }; @@ -430,17 +431,32 @@ gst_dvdemux_src_query (GstPad * pad, GstQuery * query) switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION: + { + GstFormat format; + gint64 cur; + + /* get target format */ + gst_query_parse_position (query, &format, NULL); + + /* bring the position to the requested format. */ + if (!(res = gst_pad_query_convert (pad, + GST_FORMAT_TIME, dvdemux->timestamp, &format, &cur))) + goto error; + gst_query_set_position (query, format, cur); + break; + } + case GST_QUERY_DURATION: { GstFormat format; GstFormat format2; - gint64 cur, end; + gint64 end; GstPad *peer; /* get target format */ - gst_query_parse_position (query, &format, NULL, NULL); + gst_query_parse_duration (query, &format, NULL); - /* change query to perform on peer */ - gst_query_set_position (query, GST_FORMAT_BYTES, -1, -1); + /* change query to bytes to perform on peer */ + gst_query_set_duration (query, GST_FORMAT_BYTES, -1); if ((peer = gst_pad_get_peer (dvdemux->sinkpad))) { /* ask peer for total length */ @@ -450,28 +466,22 @@ gst_dvdemux_src_query (GstPad * pad, GstQuery * query) } /* get peer total length */ - gst_query_parse_position (query, NULL, NULL, &end); + gst_query_parse_duration (query, NULL, &end); + + gst_object_unref (peer); /* convert end to requested format */ if (end != -1) { format2 = format; if (!(res = gst_pad_query_convert (dvdemux->sinkpad, GST_FORMAT_BYTES, end, &format2, &end))) { - gst_object_unref (peer); goto error; } } - gst_object_unref (peer); } else { end = -1; } - /* bring the position to the requested format. */ - if (!(res = gst_pad_query_convert (pad, - GST_FORMAT_TIME, dvdemux->timestamp, &format, &cur))) - goto error; - if (!(res = gst_pad_query_convert (pad, format2, end, &format, &end))) - goto error; - gst_query_set_position (query, format, cur, end); + gst_query_set_duration (query, format, end); break; } case GST_QUERY_CONVERT: -- cgit