From 0f5fc9646ee788e17a98fe8681baa53d13c0d25a Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 15 Oct 2020 12:08:19 -0400 Subject: [PATCH] v4l2codecs: vp8: Allow baseclass from skipping frames In preparation for !1670, this will allow the base class from skipping frames that should not be displayed. Previously it would complain about unordered decoding taking place in the driver. Part-of: --- sys/v4l2codecs/gstv4l2codecvp8dec.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/sys/v4l2codecs/gstv4l2codecvp8dec.c b/sys/v4l2codecs/gstv4l2codecvp8dec.c index f142d56d6a..0e5024c016 100644 --- a/sys/v4l2codecs/gstv4l2codecvp8dec.c +++ b/sys/v4l2codecs/gstv4l2codecvp8dec.c @@ -682,17 +682,13 @@ gst_v4l2_codec_vp8_dec_output_picture (GstVp8Decoder * decoder, goto error; } - if (!gst_v4l2_decoder_dequeue_src (self->decoder, &frame_num)) { - GST_ELEMENT_ERROR (self, STREAM, DECODE, - ("Decoder did not produce a frame"), (NULL)); - goto error; - } - - if (frame_num != picture->system_frame_number) { - GST_ELEMENT_ERROR (self, STREAM, DECODE, - ("Decoder produced out of order frame"), (NULL)); - goto error; - } + do { + if (!gst_v4l2_decoder_dequeue_src (self->decoder, &frame_num)) { + GST_ELEMENT_ERROR (self, STREAM, DECODE, + ("Decoder did not produce a frame"), (NULL)); + goto error; + } + } while (frame_num != picture->system_frame_number); finish_frame: gst_v4l2_request_set_done (request);