From b10c2cfc72da5ea7bea2c5e2977e995c082a5a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 8 Nov 2011 09:09:28 +0100 Subject: [PATCH] omxvideodec: Implement dropping of too late frames via QoS --- omx/gstomxvideodec.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index c18c48796c..9e7da441f6 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -699,7 +699,17 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self) GST_BASE_VIDEO_CODEC_STREAM_LOCK (self); frame = _find_nearest_frame (self, buf); - if (!frame && buf->omx_buf->nFilledLen > 0) { + + if (frame + && + gst_base_video_decoder_get_max_decode_time (GST_BASE_VIDEO_DECODER (self), + frame) < 0) { + GST_WARNING_OBJECT (self, "Frame is too late, dropping"); + gst_omx_port_release_buffer (self->out_port, buf); + flow_ret = + gst_base_video_decoder_finish_frame (GST_BASE_VIDEO_DECODER (self), + frame); + } else if (!frame && buf->omx_buf->nFilledLen > 0) { GstBuffer *outbuf; /* This sometimes happens at EOS or if the input is not properly framed,