From 6972026c5ad78685c2d875e2292d4e6c80fba4ef Mon Sep 17 00:00:00 2001 From: Nanxin Qin Date: Tue, 19 Sep 2017 17:37:55 +0800 Subject: [PATCH] decoder: fixed the issure of losing frames in playback PD#151174: add detection of eos data to prevent err in play state The play ready state requires 3 conditions: 1. input object is valid 2. available with chunk data 3. no eos data received Change-Id: Idee816458f2da165fce52a74c9d308a32b116d15 Signed-off-by: Nanxin Qin --- .../media_modules/frame_provider/decoder/utils/vdec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/utils/vdec.c b/drivers/amlogic/media_modules/frame_provider/decoder/utils/vdec.c index a1be82c750f6..47fe09e99082 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/utils/vdec.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/utils/vdec.c @@ -1693,10 +1693,12 @@ static inline bool vdec_ready_to_run(struct vdec_s *vdec) if ((vdec->slave || vdec->master) && (vdec->sched == 0)) return false; + /* check frame based input underrun */ - if (input && input_frame_based(input) && - (!vdec_input_next_chunk(input))) + if (input && !input->eos && input_frame_based(input) + && (!vdec_input_next_chunk(input))) return false; + /* check streaming prepare level threshold if not EOS */ if (input && input_stream_based(input) && !input->eos) { u32 rp, wp, level;