From: peter wang Date: Fri, 12 Apr 2019 05:49:21 +0000 (+0800) Subject: amvideo: fix video block when pts discontinue [1/1] X-Git-Tag: khadas-vims-v0.9.6-release~486 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3b68902c7b20a100a40b4258422d651e69da870;p=platform%2Fkernel%2Flinux-amlogic.git amvideo: fix video block when pts discontinue [1/1] PD#SWPL-5038 Problem: image will block when pts discontinue Solution: do not show the frame when pts greater than pcr Verify: tested on Marconi Change-Id: I57ea973b7fdcdc7cded2c5c9b681be29f0a31a4b Signed-off-by: peter wang --- diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 814aa87..65bd7cb 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -108,6 +108,8 @@ static int video_global_output = 1; /* video_pause_global: 0 is play, 1 is pause, 2 is invalid */ static int video_pause_global = 1; +static u32 cur_omx_index; + #ifdef CONFIG_GE2D_KEEP_FRAME /* #if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON6 */ /* #include */ @@ -5315,11 +5317,13 @@ static inline bool vpts_expire(struct vframe_s *cur_vf, /* pts==0 is a keep frame maybe. */ if (systime > next_vf->pts || next_vf->pts == 0) return true; - if (omx_secret_mode == true) + if (omx_secret_mode == true + && cur_omx_index >= next_vf->omx_index) return true; return false; - } else if (omx_secret_mode == true) + } else if (omx_secret_mode == true + && cur_omx_index >= next_vf->omx_index) return true; } else if (omx_run && omx_secret_mode @@ -8722,6 +8726,7 @@ static void set_omx_pts(u32 *p) u32 session = p[5]; unsigned int try_cnt = 0x1000; + cur_omx_index = frame_num; mutex_lock(&omx_mutex); if (omx_pts_set_index < frame_num) omx_pts_set_index = frame_num;