From: yunmin.chen Date: Fri, 24 Apr 2020 10:32:17 +0000 (+0800) Subject: avs: fixed avs pts abnormal issue. [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ca77e3cdd215e013e807bb9a04600b30c4563fa3;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_media.git avs: fixed avs pts abnormal issue. [1/1] PD#OTT-10155 Problem: The player inputs an abnormal pts to the decoder. Solution: Only the PTS of the I frame is retained. Verify: S905X2 Change-Id: I5085d2c9eb1649d39c98a5db015951adaa6c45e6 Signed-off-by: yunmin.chen --- diff --git a/drivers/frame_provider/decoder/avs/avs.c b/drivers/frame_provider/decoder/avs/avs.c index b6e500f..323f322 100644 --- a/drivers/frame_provider/decoder/avs/avs.c +++ b/drivers/frame_provider/decoder/avs/avs.c @@ -524,6 +524,7 @@ static void vavs_isr(void) pic_type = 2; if ((picture_type == I_PICTURE) && pts_valid) { vf->pts = pts; + vf->pts_us64 = pts_us64; if ((repeat_count > 1) && avi_flag) { /* next_pts = pts + * (vavs_amstream_dec_info.rate * @@ -537,6 +538,9 @@ static void vavs_isr(void) next_pts = 0; } else { vf->pts = next_pts; + if (vf->pts == 0) { + vf->pts_us64 = 0; + } if ((repeat_count > 1) && avi_flag) { /* vf->duration = * vavs_amstream_dec_info.rate * @@ -578,8 +582,11 @@ static void vavs_isr(void) pr_info("buffer_index %d, canvas addr %x\n", buffer_index, vf->canvas0Addr); } - vf->pts = (pts_valid)?pts:0; - vf->pts_us64 = (pts_valid) ? pts_us64 : 0; + + vf->pts = (pts_valid)?pts:0; + /* + *vf->pts_us64 = (pts_valid) ? pts_us64 : 0; + */ vfbuf_use[buffer_index]++; vf->mem_handle = decoder_bmmu_box_get_mem_handle( @@ -603,7 +610,9 @@ static void vavs_isr(void) vf->pts = 0; else vf->pts = next_pts; - + if (vf->pts == 0) { + vf->pts_us64 = 0; + } if ((repeat_count > 1) && avi_flag) { /* vf->duration = vavs_amstream_dec_info.rate * * repeat_count >> 1; @@ -681,6 +690,9 @@ static void vavs_isr(void) next_pts = 0; } else { vf->pts = next_pts; + if (vf->pts == 0) { + vf->pts_us64 = 0; + } if ((repeat_count > 1) && avi_flag) { /* vf->duration = * vavs_amstream_dec_info.rate * @@ -711,7 +723,9 @@ static void vavs_isr(void) index2canvas(buffer_index); vf->type_original = vf->type; vf->pts = (pts_valid)?pts:0; - vf->pts_us64 = (pts_valid) ? pts_us64 : 0; + /* + *vf->pts_us64 = (pts_valid) ? pts_us64 : 0; + */ if (debug_flag & AVS_DEBUG_PRINT) { pr_info("buffer_index %d, canvas addr %x\n", buffer_index, vf->canvas0Addr