mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +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;
|
||||
gint bpf;
|
||||
guint blocksize;
|
||||
gboolean drop_buf = FALSE;
|
||||
|
||||
GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad);
|
||||
|
||||
|
@ -1176,9 +1177,11 @@ gst_audio_mixer_mix_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad,
|
|||
if (pad->position >= pad->size) {
|
||||
/* Buffer done, drop it */
|
||||
gst_buffer_replace (&pad->buffer, NULL);
|
||||
gst_aggregator_pad_drop_buffer (aggpad);
|
||||
drop_buf = TRUE;
|
||||
}
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
if (drop_buf)
|
||||
gst_aggregator_pad_drop_buffer (aggpad);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1189,8 +1192,8 @@ gst_audio_mixer_mix_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad,
|
|||
pad->output_offset += pad->size / bpf;
|
||||
/* Buffer done, drop it */
|
||||
gst_buffer_replace (&pad->buffer, NULL);
|
||||
gst_aggregator_pad_drop_buffer (aggpad);
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
gst_aggregator_pad_drop_buffer (aggpad);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1300,11 +1303,14 @@ gst_audio_mixer_mix_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad,
|
|||
if (pad->position == pad->size) {
|
||||
/* Buffer done, drop it */
|
||||
gst_buffer_replace (&pad->buffer, NULL);
|
||||
gst_aggregator_pad_drop_buffer (aggpad);
|
||||
GST_DEBUG_OBJECT (pad, "Finished mixing buffer, waiting for next");
|
||||
drop_buf = TRUE;
|
||||
}
|
||||
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
if (drop_buf)
|
||||
gst_aggregator_pad_drop_buffer (aggpad);
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
|
Loading…
Reference in a new issue