mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
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
This commit is contained in:
parent
84b9f118e7
commit
76620459d5
2 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue