From e7f2da8ed9412a382042e19228d089cf8aaffff6 Mon Sep 17 00:00:00 2001 From: "shihong.zheng" Date: Sat, 4 Nov 2017 12:53:56 +0800 Subject: [PATCH] PD#153240: vvp9: restore checkin pts for vts Change-Id: I54b531e44d3433ee18e8b09ce94d0fde76ac391c Signed-off-by: shihong.zheng --- .../frame_provider/decoder/vp9/vvp9.c | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/vp9/vvp9.c b/drivers/amlogic/media_modules/frame_provider/decoder/vp9/vvp9.c index 5992f6724831..ffc3f3f5e716 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/vp9/vvp9.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/vp9/vvp9.c @@ -6036,8 +6036,9 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi, struct vframe_s *vf = NULL; int stream_offset = pic_config->stream_offset; unsigned short slice_type = pic_config->slice_type; - - unsigned int pts_valid = 0, pts_us64_valid = 0; + u32 pts_valid = 0, pts_us64_valid = 0; + u32 pts_save; + u64 pts_us64_save; if (debug & VP9_DEBUG_BUFMGR) pr_info("%s index = %d\r\n", __func__, pic_config->index); @@ -6084,6 +6085,8 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi, pts_us64_valid = 1; } + pts_save = vf->pts; + pts_us64_save = vf->pts_us64; if (pbi->pts_unstable) { frame_duration_adapt(pbi, vf, pts_valid); if (pbi->duration_from_pts_done) { @@ -6144,6 +6147,16 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi, pbi->pts_mode, pbi->frame_dur, vf->pts, vf->pts_us64); } + if (pbi->pts_mode == PTS_NONE_REF_USE_DURATION) { + vf->disp_pts = vf->pts; + vf->disp_pts_us64 = vf->pts_us64; + vf->pts = pts_save; + vf->pts_us64 = pts_us64_save; + } else { + vf->disp_pts = 0; + vf->disp_pts_us64 = 0; + } + vf->index = 0xff00 | pic_config->index; if (pic_config->double_write_mode & 0x10) { @@ -7206,14 +7219,13 @@ TODO:FOR VERSION ret = vp9_local_init(pbi); - /* - //note: drop for vts test + if (!pbi->pts_unstable) { pbi->pts_unstable = (pbi->vvp9_amstream_dec_info.rate == 0)?1:0; pr_info("set pts unstable\n"); } - */ + return ret; }