mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
ext/ogg/gstoggdemux.c: Explicitly check for -1 values before doing a conversion and always map them to -1. (#315545)
Original commit message from CVS: * ext/ogg/gstoggdemux.c: (gst_ogg_pad_query_convert), (gst_ogg_demux_chain_peer), (gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain): Explicitly check for -1 values before doing a conversion and always map them to -1. (#315545)
This commit is contained in:
parent
2d8a59b262
commit
c79b832176
3 changed files with 28 additions and 5 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-10-29 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_query_convert),
|
||||
(gst_ogg_demux_chain_peer), (gst_ogg_demux_perform_seek),
|
||||
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain):
|
||||
Explicitly check for -1 values before doing a conversion
|
||||
and always map them to -1. (#315545)
|
||||
|
||||
2005-10-28 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/playback/gstplaybin.c: (gen_video_element):
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit 1cb5d7b76a01c711674c752015089e70c394fa99
|
||||
Subproject commit a0c6a14dbc3cb62bf513502eaef83d0600a7c1ca
|
|
@ -726,6 +726,21 @@ gst_ogg_demux_queue_data (GstOggPad * pad, ogg_packet * packet)
|
|||
return GST_FLOW_OK;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_ogg_pad_query_convert (GstOggPad * ogg_pad, GstFormat from_format,
|
||||
gint64 from_value, GstFormat * to_format, gint64 * to_value)
|
||||
{
|
||||
if (from_value == -1) {
|
||||
*to_value = -1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (ogg_pad->elem_pad != NULL, FALSE);
|
||||
|
||||
return gst_pad_query_convert (ogg_pad->elem_pad,
|
||||
from_format, from_value, to_format, to_value);
|
||||
}
|
||||
|
||||
/* send packet to internal element */
|
||||
static GstFlowReturn
|
||||
gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet)
|
||||
|
@ -755,7 +770,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet)
|
|||
|
||||
ogg->current_granule = packet->granulepos;
|
||||
format = GST_FORMAT_TIME;
|
||||
if (!gst_pad_query_convert (pad->elem_pad,
|
||||
if (!gst_ogg_pad_query_convert (pad,
|
||||
GST_FORMAT_DEFAULT, packet->granulepos, &format,
|
||||
(gint64 *) & ogg->current_time)) {
|
||||
g_warning ("could not convert granulepos to time");
|
||||
|
@ -1564,7 +1579,7 @@ gst_ogg_demux_perform_seek (GstOggDemux * ogg, gboolean accurate,
|
|||
continue;
|
||||
|
||||
format = GST_FORMAT_TIME;
|
||||
if (!gst_pad_query_convert (pad->elem_pad,
|
||||
if (!gst_ogg_pad_query_convert (pad,
|
||||
GST_FORMAT_DEFAULT, granulepos, &format,
|
||||
(gint64 *) & granuletime)) {
|
||||
g_warning ("could not convert granulepos to time");
|
||||
|
@ -1823,7 +1838,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg)
|
|||
GstFormat target;
|
||||
|
||||
target = GST_FORMAT_TIME;
|
||||
if (!gst_pad_query_convert (pad->elem_pad,
|
||||
if (!gst_ogg_pad_query_convert (pad,
|
||||
GST_FORMAT_DEFAULT, pad->first_granule, &target,
|
||||
(gint64 *) & pad->first_time)) {
|
||||
g_warning ("could not convert granule to time");
|
||||
|
@ -1887,7 +1902,7 @@ gst_ogg_demux_read_end_chain (GstOggDemux * ogg, GstOggChain * chain)
|
|||
GstFormat target;
|
||||
|
||||
target = GST_FORMAT_TIME;
|
||||
if (!gst_pad_query_convert (pad->elem_pad,
|
||||
if (!gst_ogg_pad_query_convert (pad,
|
||||
GST_FORMAT_DEFAULT, pad->last_granule, &target,
|
||||
(gint64 *) & pad->last_time)) {
|
||||
g_warning ("could not convert granule to time");
|
||||
|
|
Loading…
Reference in a new issue