mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-08 00:18:54 +00:00
decodebin: guard against the decode chain going while a pad is added
https://bugzilla.gnome.org/show_bug.cgi?id=741355
This commit is contained in:
parent
9036dc8594
commit
a848ac7abe
1 changed files with 51 additions and 28 deletions
|
@ -1800,9 +1800,11 @@ discarded_type:
|
|||
|
||||
/* Try to expose anything */
|
||||
EXPOSE_LOCK (dbin);
|
||||
if (dbin->decode_chain) {
|
||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||
gst_decode_bin_expose (dbin);
|
||||
}
|
||||
}
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
do_async_done (dbin);
|
||||
|
||||
|
@ -1826,9 +1828,11 @@ unknown_type:
|
|||
|
||||
/* Try to expose anything */
|
||||
EXPOSE_LOCK (dbin);
|
||||
if (dbin->decode_chain) {
|
||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||
gst_decode_bin_expose (dbin);
|
||||
}
|
||||
}
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
|
||||
if (src == dbin->typefind) {
|
||||
|
@ -2686,9 +2690,11 @@ expose_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
|
|||
chain->endcaps = gst_caps_ref (caps);
|
||||
|
||||
EXPOSE_LOCK (dbin);
|
||||
if (dbin->decode_chain) {
|
||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||
gst_decode_bin_expose (dbin);
|
||||
}
|
||||
}
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
|
||||
if (mqpad)
|
||||
|
@ -2802,6 +2808,7 @@ pad_event_cb (GstPad * pad, GstPadProbeInfo * info, gpointer data)
|
|||
/* we don't set the endcaps because NULL endcaps means early EOS */
|
||||
|
||||
EXPOSE_LOCK (dbin);
|
||||
if (dbin->decode_chain)
|
||||
if (gst_decode_chain_is_complete (dbin->decode_chain))
|
||||
gst_decode_bin_expose (dbin);
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
|
@ -2828,12 +2835,16 @@ pad_added_cb (GstElement * element, GstPad * pad, GstDecodeChain * chain)
|
|||
gst_caps_unref (caps);
|
||||
|
||||
EXPOSE_LOCK (dbin);
|
||||
if (dbin->decode_chain) {
|
||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||
GST_LOG_OBJECT (dbin,
|
||||
"That was the last dynamic object, now attempting to expose the group");
|
||||
if (!gst_decode_bin_expose (dbin))
|
||||
GST_WARNING_OBJECT (dbin, "Couldn't expose group");
|
||||
}
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (dbin, "No decode chain, new pad ignored");
|
||||
}
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
}
|
||||
|
||||
|
@ -2910,9 +2921,11 @@ no_more_pads_cb (GstElement * element, GstDecodeChain * chain)
|
|||
CHAIN_MUTEX_UNLOCK (chain);
|
||||
|
||||
EXPOSE_LOCK (chain->dbin);
|
||||
if (chain->dbin->decode_chain) {
|
||||
if (gst_decode_chain_is_complete (chain->dbin->decode_chain)) {
|
||||
gst_decode_bin_expose (chain->dbin);
|
||||
}
|
||||
}
|
||||
EXPOSE_UNLOCK (chain->dbin);
|
||||
}
|
||||
|
||||
|
@ -3047,9 +3060,13 @@ gst_decode_bin_reset_buffering (GstDecodeBin * dbin)
|
|||
return;
|
||||
|
||||
GST_DEBUG_OBJECT (dbin, "Reseting multiqueues buffering");
|
||||
EXPOSE_LOCK (dbin);
|
||||
if (dbin->decode_chain) {
|
||||
CHAIN_MUTEX_LOCK (dbin->decode_chain);
|
||||
gst_decode_chain_reset_buffering (dbin->decode_chain);
|
||||
CHAIN_MUTEX_UNLOCK (dbin->decode_chain);
|
||||
}
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
}
|
||||
|
||||
/****
|
||||
|
@ -3336,10 +3353,12 @@ multi_queue_overrun_cb (GstElement * queue, GstDecodeGroup * group)
|
|||
*/
|
||||
|
||||
EXPOSE_LOCK (dbin);
|
||||
if (dbin->decode_chain) {
|
||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||
if (!gst_decode_bin_expose (dbin))
|
||||
GST_WARNING_OBJECT (dbin, "Couldn't expose group");
|
||||
}
|
||||
}
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
}
|
||||
|
||||
|
@ -3872,16 +3891,18 @@ gst_decode_pad_handle_eos (GstDecodePad * pad)
|
|||
GstDecodeBin *dbin = chain->dbin;
|
||||
|
||||
GST_LOG_OBJECT (dbin, "pad %p", pad);
|
||||
EXPOSE_LOCK (dbin);
|
||||
drain_and_switch_chains (dbin->decode_chain, pad, &last_group, &drained,
|
||||
&switched);
|
||||
|
||||
if (switched) {
|
||||
/* If we resulted in a group switch, expose what's needed */
|
||||
EXPOSE_LOCK (dbin);
|
||||
if (dbin->decode_chain) {
|
||||
if (gst_decode_chain_is_complete (dbin->decode_chain))
|
||||
gst_decode_bin_expose (dbin);
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
}
|
||||
}
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
|
||||
return last_group;
|
||||
}
|
||||
|
@ -4562,10 +4583,12 @@ source_pad_blocked_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
|
|||
dpad->blocked = TRUE;
|
||||
|
||||
EXPOSE_LOCK (dbin);
|
||||
if (dbin->decode_chain) {
|
||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||
if (!gst_decode_bin_expose (dbin))
|
||||
GST_WARNING_OBJECT (dbin, "Couldn't expose group");
|
||||
}
|
||||
}
|
||||
EXPOSE_UNLOCK (dbin);
|
||||
|
||||
done:
|
||||
|
|
Loading…
Reference in a new issue