From ec637580a8a998b8aaa496f407f53056902a84a0 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sat, 26 Jun 2010 17:55:12 +0200 Subject: [PATCH] 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 --- gst/playback/gstdecodebin2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 5a08dba446..bc3c840dfe 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -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;