diff options
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2019-12-17 15:42:03 -0800 |
---|---|---|
committer | Greg Wroblewski <musashi@google.com> | 2020-01-10 14:53:53 -0800 |
commit | 7f33b96e77cf2b17360507babd8cb8d02c635eee (patch) | |
tree | 3fe7f6f2ceceaaae2721c1f65aa6c082a887fc58 | |
parent | c4b0440fb7a36cd8692126404f86f1bd7a19701e (diff) | |
download | android_external_libavc-7f33b96e77cf2b17360507babd8cb8d02c635eee.tar.gz android_external_libavc-7f33b96e77cf2b17360507babd8cb8d02c635eee.tar.bz2 android_external_libavc-7f33b96e77cf2b17360507babd8cb8d02c635eee.zip |
decoder: Fix minimum poc calculation check while adding to display
While adding the decoded buffer to display queue, allow buffer with
poc set to 0x7FFFFFFF
Bug: 145364230
Test: poc in bug
Change-Id: I2a15f73b8422cfa4fd3360bc21c0cea4542a3375
(cherry picked from commit ffcf2a87d66f935210ebd011eed474514d086b40)
-rw-r--r-- | decoder/ih264d_utils.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/decoder/ih264d_utils.c b/decoder/ih264d_utils.c index edfb8f1..6c4ded0 100644 --- a/decoder/ih264d_utils.c +++ b/decoder/ih264d_utils.c @@ -1205,7 +1205,9 @@ WORD32 ih264d_assign_display_seq(dec_struct_t *ps_dec) && (DO_NOT_DISP != ps_dpb_mgr->ai4_poc_buf_id_map[i][0])) { - if(i4_poc_buf_id_map[i][1] < i4_min_poc) + /* Checking for <= is necessary to handle cases where there is one + valid buffer with poc set to 0x7FFFFFFF. */ + if(i4_poc_buf_id_map[i][1] <= i4_min_poc) { i4_min_poc = i4_poc_buf_id_map[i][1]; i4_min_poc_buf_id = i4_poc_buf_id_map[i][0]; @@ -1268,8 +1270,8 @@ void ih264d_release_display_bufs(dec_struct_t *ps_dec) WORD32 (*i4_poc_buf_id_map)[3] = ps_dpb_mgr->ai4_poc_buf_id_map; i4_min_poc = 0x7fffffff; - i4_min_poc_buf_id = -1; - i4_min_index = -1; + i4_min_poc_buf_id = 0; + i4_min_index = 0; ih264d_delete_nonref_nondisplay_pics(ps_dpb_mgr); @@ -1280,7 +1282,9 @@ void ih264d_release_display_bufs(dec_struct_t *ps_dec) { if(i4_poc_buf_id_map[i][0] != -1) { - if(i4_poc_buf_id_map[i][1] < i4_min_poc) + /* Checking for <= is necessary to handle cases where there is one + valid buffer with poc set to 0x7FFFFFFF. */ + if(i4_poc_buf_id_map[i][1] <= i4_min_poc) { i4_min_poc = i4_poc_buf_id_map[i][1]; i4_min_poc_buf_id = i4_poc_buf_id_map[i][0]; |