if (mix->newseg_pending) {
GST_DEBUG_OBJECT (mix, "Sending NEWSEGMENT event");
+ GST_VIDEO_MIXER2_UNLOCK (mix);
if (!gst_pad_push_event (mix->srcpad,
gst_event_new_segment (&mix->segment))) {
ret = GST_FLOW_ERROR;
- goto done;
+ goto done_unlocked;
}
+ GST_VIDEO_MIXER2_LOCK (mix);
mix->newseg_pending = FALSE;
}
if (output_start_time >= mix->segment.stop) {
GST_DEBUG_OBJECT (mix, "Segment done");
+ GST_VIDEO_MIXER2_UNLOCK (mix);
gst_pad_push_event (mix->srcpad, gst_event_new_eos ());
ret = GST_FLOW_EOS;
- goto done;
+ goto done_unlocked;
}
output_end_time =
GST_DEBUG_OBJECT (mix, "All sinkpads are EOS -- forwarding");
mix->segment.stop = output_end_time;
+ GST_VIDEO_MIXER2_UNLOCK (mix);
gst_pad_push_event (mix->srcpad, gst_event_new_segment (&mix->segment));
gst_pad_push_event (mix->srcpad, gst_event_new_eos ());
ret = GST_FLOW_EOS;
- goto done;
+ goto done_unlocked;
} else if (res == -2) {
GST_ERROR_OBJECT (mix, "Error collecting buffers");
ret = GST_FLOW_ERROR;
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)));
ret = gst_pad_push (mix->srcpad, outbuf);
}
- GST_VIDEO_MIXER2_LOCK (mix);
+ goto done_unlocked;
done:
GST_VIDEO_MIXER2_UNLOCK (mix);
+done_unlocked:
return ret;
}