From 4b6344b28159ddec7e9eb3de074d5e3affff178a Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Fri, 21 Oct 2016 11:11:38 +0530 Subject: [PATCH] Decoder: Ignore dangling fields during flush If decoder has decoded one field and is waiting for next field, and flush is called, then ignore the current decoded field. This is needed to ensure seek works in case of flush between field decode calls Bug: 32391809 Test: Tested manually by decoding clip in the above bug in Photos app Change-Id: I72bb0385c216ebe262b346a56d3bc8fb97f90a7b --- decoder/ih264d_api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c index 59160b9..859efe0 100644 --- a/decoder/ih264d_api.c +++ b/decoder/ih264d_api.c @@ -2604,6 +2604,9 @@ WORD32 ih264d_set_flush_mode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op ps_ctl_op->u4_error_code = 0; + /* Ignore dangling fields during flush */ + ps_dec->u1_top_bottom_decoded = 0; + return IV_SUCCESS; }