From 528f486513d406c45f1e30436f391f726bbb3b3d Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Tue, 29 Jul 2014 15:47:46 +0200 Subject: [PATCH] vaapidecode: decode and output all pending frames on normal EOS. The gst_vaapidecode_decode_loop() function is called within a separate task to fetch and output all frames that were decoded so far. So, if the decoder_loop_status is forcibly set to EOS when _finish() is called, then we are bound to exist the task without submitting the pending frames. If the downstream element error'ed out, then the gst_pad_push() would propagate up an error and so we will get it right for cutting off _finish() early in that case. This is a regression from 6003596. https://bugzilla.gnome.org/show_bug.cgi?id=733897 --- gst/vaapi/gstvaapidecode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 6d93f33d99..3891729e9a 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -444,7 +444,6 @@ gst_vaapidecode_decode_loop(GstVaapiDecode *decode) data to complete decoding (there no more data to feed in) */ if (decode->decoder_finish) { g_mutex_lock(&decode->decoder_mutex); - decode->decoder_loop_status = GST_FLOW_EOS; g_cond_signal(&decode->decoder_finish_done); g_mutex_unlock(&decode->decoder_mutex); return; @@ -499,7 +498,7 @@ gst_vaapidecode_finish(GstVideoDecoder *vdec) if (decode->decoder_loop_status == GST_FLOW_OK) { GST_VIDEO_DECODER_STREAM_UNLOCK(vdec); g_mutex_lock(&decode->decoder_mutex); - while (decode->decoder_loop_status != GST_FLOW_OK) + while (decode->decoder_loop_status == GST_FLOW_OK) g_cond_wait(&decode->decoder_finish_done, &decode->decoder_mutex); g_mutex_unlock(&decode->decoder_mutex); gst_pad_stop_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode));