diff options
author | Edward Hervey <bilboed@bilboed.com> | 2010-06-26 17:55:12 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2010-06-26 17:57:24 +0200 |
commit | ec637580a8a998b8aaa496f407f53056902a84a0 (patch) | |
tree | 043492c84f8ac285474b0a5a48041afc67ac9601 | |
parent | 24ede639ad9cc9d12e22527ec172705121fa13f7 (diff) |
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
-rw-r--r-- | gst/playback/gstdecodebin2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 5a08dba44..bc3c840df 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; |