av1: fix av1 av sync nts problem. [1/1]
authorshihong.zheng <shihong.zheng@amlogic.com>
Mon, 10 Aug 2020 04:16:52 +0000 (12:16 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Wed, 12 Aug 2020 02:12:00 +0000 (19:12 -0700)
PD#SWPL-31133

Problem:
nts av sync test failed. av1 decoder
drop first pts which value is 0.

Solution:
change the pts save condition. fix
first pts drop bug.

Verify:
ah212

Change-Id: I7eeafd38ab8215d55f0d5efe7de0a027f42ea1a2
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
drivers/frame_provider/decoder/vav1/vav1.c

index cd2e598c3982504e459050db16f05971a28690d3..4a8e2ebc0779c454e7d40fee1b2806eeb16d1f1c 100644 (file)
@@ -9603,10 +9603,15 @@ static void av1_frame_mode_pts_save(struct AV1HW_s *hw)
        u64 i, valid_pts_diff_cnt, pts_diff_sum;
        u64 in_pts_diff, last_valid_pts_diff, calc_dur;
 
-       if ((hw->chunk == NULL) ||
-               (hw->frame_count && (hw->chunk->pts == 0)) ||
-               (hw->frame_mode_pts_save[0] == hw->chunk->pts))
+       if (hw->chunk == NULL)
                return;
+       /* no return when first pts is 0 */
+       if (hw->first_pts_index) {
+               /* filtration pts 0 and continuous same pts */
+               if ((hw->chunk->pts == 0) ||
+                       (hw->frame_mode_pts_save[0] == hw->chunk->pts))
+               return;
+       }
        av1_print(hw, AV1_DEBUG_OUT_PTS,
                "run_front: pts %d, pts64 %lld, ts: %llu\n",
                hw->chunk->pts, hw->chunk->pts64, hw->chunk->timestamp);