mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +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>
|
2005-10-04 Michael Smith <msmith@fluendo.com>
|
||||||
|
|
||||||
* gst/autodetect/gstautoaudiosink.c: (gst_auto_audio_sink_reset),
|
* 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:
|
case GST_FORMAT_DEFAULT:
|
||||||
if (pad == dvdemux->videosrcpad) {
|
if (pad == dvdemux->videosrcpad) {
|
||||||
if (src_value)
|
if (src_value)
|
||||||
*dest_value = src_value / (dvdemux->framerate * GST_SECOND);
|
*dest_value = src_value * dvdemux->framerate / GST_SECOND;
|
||||||
else
|
else
|
||||||
*dest_value = 0;
|
*dest_value = 0;
|
||||||
} else if (pad == dvdemux->audiosrcpad)
|
} else if (pad == dvdemux->audiosrcpad) {
|
||||||
*dest_value = 2 * src_value * dvdemux->frequency *
|
*dest_value = 2 * src_value * dvdemux->frequency *
|
||||||
dvdemux->channels / (GST_SECOND *
|
dvdemux->channels / (GST_SECOND *
|
||||||
gst_audio_frame_byte_size (pad));
|
gst_audio_frame_byte_size (pad));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
|
@ -454,7 +455,7 @@ gst_dvdemux_src_query (GstPad * pad, GstQuery * query)
|
||||||
/* convert end to requested format */
|
/* convert end to requested format */
|
||||||
if (end != -1) {
|
if (end != -1) {
|
||||||
format2 = format;
|
format2 = format;
|
||||||
if (!(res = gst_pad_query_convert (pad,
|
if (!(res = gst_pad_query_convert (dvdemux->sinkpad,
|
||||||
GST_FORMAT_BYTES, end, &format2, &end))) {
|
GST_FORMAT_BYTES, end, &format2, &end))) {
|
||||||
gst_object_unref (peer);
|
gst_object_unref (peer);
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -468,6 +469,8 @@ gst_dvdemux_src_query (GstPad * pad, GstQuery * query)
|
||||||
if (!(res = gst_pad_query_convert (pad,
|
if (!(res = gst_pad_query_convert (pad,
|
||||||
GST_FORMAT_TIME, dvdemux->timestamp, &format, &cur)))
|
GST_FORMAT_TIME, dvdemux->timestamp, &format, &cur)))
|
||||||
goto error;
|
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_position (query, format, cur, end);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue