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
This commit is contained in:
Gwenole Beauchesne 2014-07-29 15:47:46 +02:00
parent 0504986408
commit 528f486513

View file

@ -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));