mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
audiomixer: Release pad object lock before dropping buffer
Otherwise, the locking order is violated and deadlocks happen. https://bugzilla.gnome.org/show_bug.cgi?id=745768
This commit is contained in:
parent
2d553d1b25
commit
ff9be3ba34
1 changed files with 9 additions and 3 deletions
|
@ -1141,6 +1141,7 @@ gst_audio_mixer_mix_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad,
|
||||||
GstMapInfo inmap;
|
GstMapInfo inmap;
|
||||||
gint bpf;
|
gint bpf;
|
||||||
guint blocksize;
|
guint blocksize;
|
||||||
|
gboolean drop_buf = FALSE;
|
||||||
|
|
||||||
GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad);
|
GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad);
|
||||||
|
|
||||||
|
@ -1176,9 +1177,11 @@ gst_audio_mixer_mix_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad,
|
||||||
if (pad->position >= pad->size) {
|
if (pad->position >= pad->size) {
|
||||||
/* Buffer done, drop it */
|
/* Buffer done, drop it */
|
||||||
gst_buffer_replace (&pad->buffer, NULL);
|
gst_buffer_replace (&pad->buffer, NULL);
|
||||||
gst_aggregator_pad_drop_buffer (aggpad);
|
drop_buf = TRUE;
|
||||||
}
|
}
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
if (drop_buf)
|
||||||
|
gst_aggregator_pad_drop_buffer (aggpad);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1189,8 +1192,8 @@ gst_audio_mixer_mix_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad,
|
||||||
pad->output_offset += pad->size / bpf;
|
pad->output_offset += pad->size / bpf;
|
||||||
/* Buffer done, drop it */
|
/* Buffer done, drop it */
|
||||||
gst_buffer_replace (&pad->buffer, NULL);
|
gst_buffer_replace (&pad->buffer, NULL);
|
||||||
gst_aggregator_pad_drop_buffer (aggpad);
|
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
gst_aggregator_pad_drop_buffer (aggpad);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1300,11 +1303,14 @@ gst_audio_mixer_mix_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad,
|
||||||
if (pad->position == pad->size) {
|
if (pad->position == pad->size) {
|
||||||
/* Buffer done, drop it */
|
/* Buffer done, drop it */
|
||||||
gst_buffer_replace (&pad->buffer, NULL);
|
gst_buffer_replace (&pad->buffer, NULL);
|
||||||
gst_aggregator_pad_drop_buffer (aggpad);
|
|
||||||
GST_DEBUG_OBJECT (pad, "Finished mixing buffer, waiting for next");
|
GST_DEBUG_OBJECT (pad, "Finished mixing buffer, waiting for next");
|
||||||
|
drop_buf = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
|
||||||
|
if (drop_buf)
|
||||||
|
gst_aggregator_pad_drop_buffer (aggpad);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
|
Loading…
Reference in a new issue