oggdemux: activate_chain must not be called with a NULL chain

It will crash later and shouldn't really happen anyway unless
something is really wrong.
This commit is contained in:
Sebastian Dröge 2010-06-14 11:11:56 +02:00
parent 9c570dbced
commit 9a971980b7

View file

@ -1743,6 +1743,9 @@ gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain,
GstEvent * event)
{
gint i;
gint bitrate, idx_bitrate;
g_return_val_if_fail (chain != NULL, FALSE);
if (chain == ogg->current_chain) {
if (event)
@ -1750,9 +1753,6 @@ gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain,
return TRUE;
}
/* FIXME, should not be called with NULL */
if (chain != NULL) {
gint bitrate, idx_bitrate;
GST_DEBUG_OBJECT (ogg, "activating chain %p", chain);
@ -1794,7 +1794,6 @@ gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain,
}
/* prefer the index bitrate over the ones encoded in the streams */
ogg->bitrate = (idx_bitrate ? idx_bitrate : bitrate);
}
/* after adding the new pads, remove the old pads */
gst_ogg_demux_deactivate_current_chain (ogg);