Commit 76620459 authored by Edward Hervey's avatar Edward Hervey

ext/dv/gstdvdemux.c: Fixes for better conversion

Original commit message from CVS:
* ext/dv/gstdvdemux.c: (gst_dvdemux_src_convert),
(gst_dvdemux_src_query):
Fixes for better conversion
parent 84b9f118
2005-10-05 Edward Hervey <edward@fluendo.com>
* ext/dv/gstdvdemux.c: (gst_dvdemux_src_convert),
(gst_dvdemux_src_query):
Fixes for better conversion
2005-10-04 Michael Smith <msmith@fluendo.com>
* gst/autodetect/gstautoaudiosink.c: (gst_auto_audio_sink_reset),
......
......@@ -284,13 +284,14 @@ gst_dvdemux_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value,
case GST_FORMAT_DEFAULT:
if (pad == dvdemux->videosrcpad) {
if (src_value)
*dest_value = src_value / (dvdemux->framerate * GST_SECOND);
*dest_value = src_value * dvdemux->framerate / GST_SECOND;
else
*dest_value = 0;
} else if (pad == dvdemux->audiosrcpad)
} else if (pad == dvdemux->audiosrcpad) {
*dest_value = 2 * src_value * dvdemux->frequency *
dvdemux->channels / (GST_SECOND *
gst_audio_frame_byte_size (pad));
}
break;
default:
res = FALSE;
......@@ -454,7 +455,7 @@ gst_dvdemux_src_query (GstPad * pad, GstQuery * query)
/* convert end to requested format */
if (end != -1) {
format2 = format;
if (!(res = gst_pad_query_convert (pad,
if (!(res = gst_pad_query_convert (dvdemux->sinkpad,
GST_FORMAT_BYTES, end, &format2, &end))) {
gst_object_unref (peer);
goto error;
......@@ -468,6 +469,8 @@ gst_dvdemux_src_query (GstPad * pad, GstQuery * query)
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);
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