vaapidecode: start the decoder task again after finishing

This allows the element to accept data again after draining without
a hard reset or caps change happening in between.

https://bugzilla.gnome.org/show_bug.cgi?id=734616
This commit is contained in:
Sebastian Dröge 2014-08-12 13:01:57 +03:00 committed by Gwenole Beauchesne
parent 2af44842c6
commit 3b2e06be6c

View file

@ -500,8 +500,8 @@ gst_vaapidecode_finish(GstVideoDecoder *vdec)
/* Make sure the decode loop function has a chance to return, thus
possibly unlocking gst_video_decoder_finish_frame() */
decode->decoder_finish = TRUE;
if (decode->decoder_loop_status == GST_FLOW_OK) {
decode->decoder_finish = TRUE;
GST_VIDEO_DECODER_STREAM_UNLOCK(vdec);
g_mutex_lock(&decode->decoder_mutex);
while (decode->decoder_loop_status == GST_FLOW_OK)
@ -509,8 +509,10 @@ gst_vaapidecode_finish(GstVideoDecoder *vdec)
g_mutex_unlock(&decode->decoder_mutex);
gst_pad_stop_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode));
GST_VIDEO_DECODER_STREAM_LOCK(vdec);
decode->decoder_finish = FALSE;
gst_pad_start_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode),
(GstTaskFunction)gst_vaapidecode_decode_loop, decode, NULL);
}
decode->decoder_finish = FALSE;
return ret;
}