From d1896deaf15ad8c6d148702899426b64601a3358 Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Tue, 20 Dec 2016 12:16:31 +0530 Subject: [PATCH] Decoder: Fix in returning incomplete frame error In case a slice start code is found and picture decode is not complete and a non slice NAL is encountered, then mark the current pic as incomplete Bug: 33250932 Bug: 33139050 Change-Id: I9db4446338b307310805dba90c60c8cbdeee0739 --- decoder/ih264d_parse_headers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c index 3f1dcad..7b0bdcb 100644 --- a/decoder/ih264d_parse_headers.c +++ b/decoder/ih264d_parse_headers.c @@ -1113,7 +1113,9 @@ WORD32 ih264d_parse_nal_unit(iv_obj_t *dec_hdl, u1_nal_unit_type = NAL_UNIT_TYPE(u1_first_byte); // if any other nal unit other than slice nal is encountered in between a // frame break out of loop without consuming header - if((ps_dec->u2_total_mbs_coded != 0) && (u1_nal_unit_type > IDR_SLICE_NAL)) + if ((ps_dec->u4_slice_start_code_found == 1) + && (ps_dec->u1_pic_decode_done != 1) + && (u1_nal_unit_type > IDR_SLICE_NAL)) { return ERROR_INCOMPLETE_FRAME; }