From 3b2e06be6cd5d42a9961c0a0c635289c54f48d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 12 Aug 2014 13:01:57 +0300 Subject: [PATCH] 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 --- gst/vaapi/gstvaapidecode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index aab99ade5c..4f716c6a78 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -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; }