summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2019-12-17 23:42:03 (GMT)
committerVasyl Gello <vasek.gello@gmail.com>2020-03-03 11:41:48 (GMT)
commitf1129fed20968143092aa645c7d0315658940c99 (patch)
tree73bbf710598998e052fae2547aa065de9e215470
parent9e035c8d16bae3048064b7c1de2b55744742373f (diff)
downloadandroid_external_libavc-cm-14.1.zip
android_external_libavc-cm-14.1.tar.gz
android_external_libavc-cm-14.1.tar.bz2
decoder: Fix minimum poc calculation check while adding to displaycm-14.1
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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/decoder/ih264d_utils.c b/decoder/ih264d_utils.c
index b37acec..83ad19e 100644
--- a/decoder/ih264d_utils.c
+++ b/decoder/ih264d_utils.c
@@ -1227,7 +1227,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];
@@ -1290,8 +1292,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);
@@ -1302,7 +1304,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];