videoencoder: Release STREAM_LOCK during gst_pad_push()

Release STREAM_LOCK before calling gst_pad_push() and take it
back afterward so that upstream isn't blocked while output
buffer is being pushed downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
This commit is contained in:
Alexey Chernov 2013-11-25 20:49:50 +04:00 committed by Nicolas Dufresne
parent fb49674a39
commit 595dd27ede

View file

@ -2297,7 +2297,9 @@ gst_video_encoder_finish_frame (GstVideoEncoder * encoder,
discont = FALSE;
}
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
gst_pad_push (encoder->srcpad, gst_buffer_ref (tmpbuf));
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
}
priv->new_headers = FALSE;
}
@ -2335,8 +2337,11 @@ gst_video_encoder_finish_frame (GstVideoEncoder * encoder,
gst_video_encoder_release_frame (encoder, frame);
frame = NULL;
if (ret == GST_FLOW_OK)
if (ret == GST_FLOW_OK) {
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
ret = gst_pad_push (encoder->srcpad, buffer);
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
}
done:
/* handed out */