}
}
+/* This function has to be called with the stream lock taken. */
static GstFlowReturn
gst_video_decoder_drain_out (GstVideoDecoder * dec, gboolean at_eos)
{
GstVideoDecoderPrivate *priv = dec->priv;
GstFlowReturn ret = GST_FLOW_OK;
- GST_VIDEO_DECODER_STREAM_LOCK (dec);
-
if (dec->input_segment.rate > 0.0) {
/* Forward mode, if unpacketized, give the child class
* a final chance to flush out packets */
ret = gst_video_decoder_flush_parse (dec, TRUE);
}
- GST_VIDEO_DECODER_STREAM_UNLOCK (dec);
-
return ret;
}
{
GstFlowReturn flow_ret = GST_FLOW_OK;
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
flow_ret = gst_video_decoder_drain_out (decoder, FALSE);
ret = (flow_ret == GST_FLOW_OK);
GST_DEBUG_OBJECT (decoder, "received STREAM_START. Clearing taglist");
- GST_VIDEO_DECODER_STREAM_LOCK (decoder);
/* Flush upstream tags after a STREAM_START */
if (priv->upstream_tags) {
gst_tag_list_unref (priv->upstream_tags);
{
GstFlowReturn flow_ret = GST_FLOW_OK;
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
flow_ret = gst_video_decoder_drain_out (decoder, TRUE);
+ GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
ret = (flow_ret == GST_FLOW_OK);
/* Forward SEGMENT_DONE immediately. This is required
{
GstFlowReturn flow_ret = GST_FLOW_OK;
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
flow_ret = gst_video_decoder_drain_out (decoder, TRUE);
+ GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
ret = (flow_ret == GST_FLOW_OK);
/* Error out even if EOS was ok when we had input, but no output */
GList *events;
GList *frame_events;
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
flow_ret = gst_video_decoder_drain_out (decoder, FALSE);
ret = (flow_ret == GST_FLOW_OK);
/* Ensure we have caps before forwarding the event */
- GST_VIDEO_DECODER_STREAM_LOCK (decoder);
if (!decoder->priv->output_state) {
if (!gst_video_decoder_negotiate_default_caps (decoder)) {
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
if (gst_video_event_parse_still_frame (event, &in_still)) {
if (in_still) {
GST_DEBUG_OBJECT (decoder, "draining current data for still-frame");
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
flow_ret = gst_video_decoder_drain_out (decoder, FALSE);
+ GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
ret = (flow_ret == GST_FLOW_OK);
}
/* Forward STILL_FRAME immediately. Everything is drained after