decodebin2: Properly clean DecodeChain after errors.

If an error happens, the PAUSED state will never be reached. If an
application re-uses decodebin2 (like totem) where one would normally
set to READY between each file, the cleanup that normally happens in
the PAUSED=>READY codepath will never be called, resulting in the
following file to re-use the previous demuxer/decoder/...

https://bugzilla.gnome.org/show_bug.cgi?id=622807
This commit is contained in:
Edward Hervey 2010-06-26 17:55:12 +02:00
parent 24ede639ad
commit ec637580a8

View file

@ -3492,6 +3492,11 @@ gst_decode_bin_change_state (GstElement * element, GstStateChange transition)
g_mutex_unlock (dbin->factories_lock);
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
/* Make sure we've cleared all existing chains */
if (dbin->decode_chain) {
gst_decode_chain_free (dbin->decode_chain);
dbin->decode_chain = NULL;
}
DYN_LOCK (dbin);
GST_LOG_OBJECT (dbin, "clearing shutdown flag");
dbin->shutdown = FALSE;