mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +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,8 +1800,10 @@ discarded_type:
|
||||||
|
|
||||||
/* Try to expose anything */
|
/* Try to expose anything */
|
||||||
EXPOSE_LOCK (dbin);
|
EXPOSE_LOCK (dbin);
|
||||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
if (dbin->decode_chain) {
|
||||||
gst_decode_bin_expose (dbin);
|
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||||
|
gst_decode_bin_expose (dbin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EXPOSE_UNLOCK (dbin);
|
EXPOSE_UNLOCK (dbin);
|
||||||
do_async_done (dbin);
|
do_async_done (dbin);
|
||||||
|
@ -1826,8 +1828,10 @@ unknown_type:
|
||||||
|
|
||||||
/* Try to expose anything */
|
/* Try to expose anything */
|
||||||
EXPOSE_LOCK (dbin);
|
EXPOSE_LOCK (dbin);
|
||||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
if (dbin->decode_chain) {
|
||||||
gst_decode_bin_expose (dbin);
|
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||||
|
gst_decode_bin_expose (dbin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EXPOSE_UNLOCK (dbin);
|
EXPOSE_UNLOCK (dbin);
|
||||||
|
|
||||||
|
@ -2686,8 +2690,10 @@ expose_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
|
||||||
chain->endcaps = gst_caps_ref (caps);
|
chain->endcaps = gst_caps_ref (caps);
|
||||||
|
|
||||||
EXPOSE_LOCK (dbin);
|
EXPOSE_LOCK (dbin);
|
||||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
if (dbin->decode_chain) {
|
||||||
gst_decode_bin_expose (dbin);
|
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||||
|
gst_decode_bin_expose (dbin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EXPOSE_UNLOCK (dbin);
|
EXPOSE_UNLOCK (dbin);
|
||||||
|
|
||||||
|
@ -2802,8 +2808,9 @@ pad_event_cb (GstPad * pad, GstPadProbeInfo * info, gpointer data)
|
||||||
/* we don't set the endcaps because NULL endcaps means early EOS */
|
/* we don't set the endcaps because NULL endcaps means early EOS */
|
||||||
|
|
||||||
EXPOSE_LOCK (dbin);
|
EXPOSE_LOCK (dbin);
|
||||||
if (gst_decode_chain_is_complete (dbin->decode_chain))
|
if (dbin->decode_chain)
|
||||||
gst_decode_bin_expose (dbin);
|
if (gst_decode_chain_is_complete (dbin->decode_chain))
|
||||||
|
gst_decode_bin_expose (dbin);
|
||||||
EXPOSE_UNLOCK (dbin);
|
EXPOSE_UNLOCK (dbin);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -2828,11 +2835,15 @@ pad_added_cb (GstElement * element, GstPad * pad, GstDecodeChain * chain)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
EXPOSE_LOCK (dbin);
|
EXPOSE_LOCK (dbin);
|
||||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
if (dbin->decode_chain) {
|
||||||
GST_LOG_OBJECT (dbin,
|
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||||
"That was the last dynamic object, now attempting to expose the group");
|
GST_LOG_OBJECT (dbin,
|
||||||
if (!gst_decode_bin_expose (dbin))
|
"That was the last dynamic object, now attempting to expose the group");
|
||||||
GST_WARNING_OBJECT (dbin, "Couldn't expose 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);
|
EXPOSE_UNLOCK (dbin);
|
||||||
}
|
}
|
||||||
|
@ -2910,8 +2921,10 @@ no_more_pads_cb (GstElement * element, GstDecodeChain * chain)
|
||||||
CHAIN_MUTEX_UNLOCK (chain);
|
CHAIN_MUTEX_UNLOCK (chain);
|
||||||
|
|
||||||
EXPOSE_LOCK (chain->dbin);
|
EXPOSE_LOCK (chain->dbin);
|
||||||
if (gst_decode_chain_is_complete (chain->dbin->decode_chain)) {
|
if (chain->dbin->decode_chain) {
|
||||||
gst_decode_bin_expose (chain->dbin);
|
if (gst_decode_chain_is_complete (chain->dbin->decode_chain)) {
|
||||||
|
gst_decode_bin_expose (chain->dbin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EXPOSE_UNLOCK (chain->dbin);
|
EXPOSE_UNLOCK (chain->dbin);
|
||||||
}
|
}
|
||||||
|
@ -3047,9 +3060,13 @@ gst_decode_bin_reset_buffering (GstDecodeBin * dbin)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (dbin, "Reseting multiqueues buffering");
|
GST_DEBUG_OBJECT (dbin, "Reseting multiqueues buffering");
|
||||||
CHAIN_MUTEX_LOCK (dbin->decode_chain);
|
EXPOSE_LOCK (dbin);
|
||||||
gst_decode_chain_reset_buffering (dbin->decode_chain);
|
if (dbin->decode_chain) {
|
||||||
CHAIN_MUTEX_UNLOCK (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,9 +3353,11 @@ multi_queue_overrun_cb (GstElement * queue, GstDecodeGroup * group)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EXPOSE_LOCK (dbin);
|
EXPOSE_LOCK (dbin);
|
||||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
if (dbin->decode_chain) {
|
||||||
if (!gst_decode_bin_expose (dbin))
|
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||||
GST_WARNING_OBJECT (dbin, "Couldn't expose group");
|
if (!gst_decode_bin_expose (dbin))
|
||||||
|
GST_WARNING_OBJECT (dbin, "Couldn't expose group");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EXPOSE_UNLOCK (dbin);
|
EXPOSE_UNLOCK (dbin);
|
||||||
}
|
}
|
||||||
|
@ -3872,16 +3891,18 @@ gst_decode_pad_handle_eos (GstDecodePad * pad)
|
||||||
GstDecodeBin *dbin = chain->dbin;
|
GstDecodeBin *dbin = chain->dbin;
|
||||||
|
|
||||||
GST_LOG_OBJECT (dbin, "pad %p", pad);
|
GST_LOG_OBJECT (dbin, "pad %p", pad);
|
||||||
|
EXPOSE_LOCK (dbin);
|
||||||
drain_and_switch_chains (dbin->decode_chain, pad, &last_group, &drained,
|
drain_and_switch_chains (dbin->decode_chain, pad, &last_group, &drained,
|
||||||
&switched);
|
&switched);
|
||||||
|
|
||||||
if (switched) {
|
if (switched) {
|
||||||
/* If we resulted in a group switch, expose what's needed */
|
/* 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))
|
if (gst_decode_chain_is_complete (dbin->decode_chain))
|
||||||
gst_decode_bin_expose (dbin);
|
gst_decode_bin_expose (dbin);
|
||||||
EXPOSE_UNLOCK (dbin);
|
}
|
||||||
}
|
}
|
||||||
|
EXPOSE_UNLOCK (dbin);
|
||||||
|
|
||||||
return last_group;
|
return last_group;
|
||||||
}
|
}
|
||||||
|
@ -4562,9 +4583,11 @@ source_pad_blocked_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
|
||||||
dpad->blocked = TRUE;
|
dpad->blocked = TRUE;
|
||||||
|
|
||||||
EXPOSE_LOCK (dbin);
|
EXPOSE_LOCK (dbin);
|
||||||
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
if (dbin->decode_chain) {
|
||||||
if (!gst_decode_bin_expose (dbin))
|
if (gst_decode_chain_is_complete (dbin->decode_chain)) {
|
||||||
GST_WARNING_OBJECT (dbin, "Couldn't expose group");
|
if (!gst_decode_bin_expose (dbin))
|
||||||
|
GST_WARNING_OBJECT (dbin, "Couldn't expose group");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EXPOSE_UNLOCK (dbin);
|
EXPOSE_UNLOCK (dbin);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue