vaapidecode: Requests upstream a key unit at parse or decode error.

This is done to resume decoding after a parse error or decode error.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=797006
This commit is contained in:
Matteo Valdina 2018-08-31 20:56:13 -05:00 committed by Víctor Manuel Jáquez Leal
parent 2cb795fc77
commit 7872d12695

View file

@ -763,6 +763,11 @@ error_decode:
ret = GST_FLOW_OK; ret = GST_FLOW_OK;
GST_VIDEO_DECODER_ERROR (vdec, 1, STREAM, DECODE, ("Decoding error"), GST_VIDEO_DECODER_ERROR (vdec, 1, STREAM, DECODE, ("Decoding error"),
("Decode error %d", status), ret); ("Decode error %d", status), ret);
GST_INFO ("requesting upstream a key unit");
gst_pad_push_event (GST_VIDEO_DECODER_SINK_PAD (decode),
gst_video_event_new_upstream_force_key_unit (GST_CLOCK_TIME_NONE,
FALSE, 0));
ret = GST_FLOW_OK;
break; break;
} }
gst_video_decoder_drop_frame (vdec, frame); gst_video_decoder_drop_frame (vdec, frame);
@ -1179,10 +1184,15 @@ gst_vaapidecode_parse_frame (GstVideoDecoder * vdec,
decode->current_frame_size = 0; decode->current_frame_size = 0;
break; break;
default: default:
GST_ERROR ("parse error %d", status); GST_WARNING ("parse error %d", status);
/* just keep parsing, the decoder should have flushed the broken unit */ /* just keep parsing, the decoder should have flushed the broken unit */
ret = GST_VAAPI_DECODE_FLOW_PARSE_DATA; ret = GST_VAAPI_DECODE_FLOW_PARSE_DATA;
decode->current_frame_size = 0; decode->current_frame_size = 0;
GST_INFO ("requesting upstream a key unit");
gst_pad_push_event (GST_VIDEO_DECODER_SINK_PAD (decode),
gst_video_event_new_upstream_force_key_unit (GST_CLOCK_TIME_NONE,
FALSE, 0));
break; break;
} }
return ret; return ret;