From: shuanglong.wang Date: Mon, 24 Jun 2019 09:31:43 +0000 (+0800) Subject: video: modify omxpts compenstate condition [1/1] X-Git-Tag: hardkernel-4.9.236-104~1032 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6facee1488206e319ba670a561ead9c25a235185;p=platform%2Fkernel%2Flinux-amlogic.git video: modify omxpts compenstate condition [1/1] PD#SWPL-9676 Problem: h264 non-tunnel mode video, video resume play will frezee one frame after pause Solution: modify omxpts compenstate condition to let pcr stop in time Verify: verify by nts Change-Id: I719150064b0abe4fdfd230a2429cfdfc000ea786 Signed-off-by: shuanglong.wang --- diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 0de0582..6d24a6a 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -155,6 +155,7 @@ static bool nopostvideostart; static int hold_property_changed; static struct video_frame_detect_s video_frame_detect; static long long time_setomxpts; +static long long time_setomxpts_last; /*----omx_info bit0: keep_last_frame, bit1~31: unused----*/ static u32 omx_info = 0x1; @@ -6836,10 +6837,10 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id) /* is not update for a while, in case when */ /* paused, pcr is not paused */ delta1 = func_div(sched_clock() - time_setomxpts, 1000); - if (((diff - omx_pts_interval_upper * 3 / 2) > 0) - || ((diff - omx_pts_interval_lower * 3 / 2) - < 0)) { + if ((time_setomxpts - time_setomxpts_last) > + (4 * vsync_pts_inc * 1000 / 90)) { time_setomxpts = 0; + time_setomxpts_last = 0; pr_info("omxpts is not update for a while,do not need compenstate\n"); } else { diff -= delta1 * 90 / 1000; @@ -8700,6 +8701,7 @@ static void video_vf_unreg_provider(void) show_first_frame_nosync = false; time_setomxpts = 0; + time_setomxpts_last = 0; #ifdef PTS_LOGGING { @@ -9273,6 +9275,7 @@ static void set_omx_pts(u32 *p) } } if (not_reset == 0) { + time_setomxpts_last = time_setomxpts; time_setomxpts = sched_clock(); omx_pts = tmp_pts; ATRACE_COUNTER("omxpts", omx_pts);