mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 13:55:41 +00:00
ext/mpeg2dec/gstmpeg2dec.c: Remember the query duration format before passing it upstream since it could have been mo...
Original commit message from CVS: * ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_sink_convert), (gst_mpeg2dec_src_query): Remember the query duration format before passing it upstream since it could have been modified. Add GST_WARNING_OBJECT in sink convert function to detail why the conversion didn't work.
This commit is contained in:
parent
bb3cfb1e44
commit
14af59f636
3 changed files with 21 additions and 6 deletions
|
@ -1,3 +1,12 @@
|
|||
2006-05-02 Edward Hervey <edward@fluendo.com>
|
||||
|
||||
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_sink_convert),
|
||||
(gst_mpeg2dec_src_query):
|
||||
Remember the query duration format before passing it upstream since it
|
||||
could have been modified.
|
||||
Add GST_WARNING_OBJECT in sink convert function to detail why the
|
||||
conversion didn't work.
|
||||
|
||||
2006-04-26 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* ext/mad/gstid3tag.c:
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit a6710e67fd82147e32a18f1b63177583faffd498
|
||||
Subproject commit 6b67aa6dd111fb139e1be0f6a386e3ff84cce091
|
|
@ -1060,8 +1060,12 @@ gst_mpeg2dec_sink_convert (GstPad * pad, GstFormat src_format, gint64 src_value,
|
|||
case GST_FORMAT_TIME:
|
||||
if (info->sequence && info->sequence->byte_rate) {
|
||||
*dest_value = GST_SECOND * src_value / info->sequence->byte_rate;
|
||||
GST_WARNING_OBJECT (mpeg2dec, "dest_value:%" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (*dest_value));
|
||||
break;
|
||||
}
|
||||
} else if (info->sequence)
|
||||
GST_WARNING_OBJECT (mpeg2dec,
|
||||
"Cannot convert from BYTES to TIME since we don't know the bitrate at this point.");
|
||||
default:
|
||||
res = FALSE;
|
||||
}
|
||||
|
@ -1072,7 +1076,9 @@ gst_mpeg2dec_sink_convert (GstPad * pad, GstFormat src_format, gint64 src_value,
|
|||
if (info->sequence && info->sequence->byte_rate) {
|
||||
*dest_value = src_value * info->sequence->byte_rate / GST_SECOND;
|
||||
break;
|
||||
}
|
||||
} else if (info->sequence)
|
||||
GST_WARNING_OBJECT (mpeg2dec,
|
||||
"Cannot convert from TIME to BYTES since we don't know the bitrate at this point.");
|
||||
default:
|
||||
res = FALSE;
|
||||
}
|
||||
|
@ -1195,6 +1201,9 @@ gst_mpeg2dec_src_query (GstPad * pad, GstQuery * query)
|
|||
if ((peer = gst_pad_get_peer (mpeg2dec->sinkpad)) == NULL)
|
||||
goto error;
|
||||
|
||||
/* save requested format */
|
||||
gst_query_parse_duration (query, &format, NULL);
|
||||
|
||||
/* send to peer */
|
||||
if ((res = gst_pad_query (peer, query))) {
|
||||
gst_object_unref (peer);
|
||||
|
@ -1203,9 +1212,6 @@ gst_mpeg2dec_src_query (GstPad * pad, GstQuery * query)
|
|||
GST_LOG_OBJECT (mpeg2dec, "query on peer pad failed, trying bytes");
|
||||
}
|
||||
|
||||
/* save requested format */
|
||||
gst_query_parse_duration (query, &format, NULL);
|
||||
|
||||
/* query peer for total length in bytes */
|
||||
gst_query_set_duration (query, GST_FORMAT_BYTES, -1);
|
||||
|
||||
|
|
Loading…
Reference in a new issue