mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:46:13 +00:00
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:
parent
24ede639ad
commit
ec637580a8
1 changed files with 5 additions and 0 deletions
|
@ -3492,6 +3492,11 @@ gst_decode_bin_change_state (GstElement * element, GstStateChange transition)
|
||||||
g_mutex_unlock (dbin->factories_lock);
|
g_mutex_unlock (dbin->factories_lock);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
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);
|
DYN_LOCK (dbin);
|
||||||
GST_LOG_OBJECT (dbin, "clearing shutdown flag");
|
GST_LOG_OBJECT (dbin, "clearing shutdown flag");
|
||||||
dbin->shutdown = FALSE;
|
dbin->shutdown = FALSE;
|
||||||
|
|
Loading…
Reference in a new issue