From: Rui Wang Date: Tue, 14 May 2019 05:22:58 +0000 (+0800) Subject: video: enable pts calculation when hold video state changes [1/1] X-Git-Tag: hardkernel-4.9.236-104~1250 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e98d6d344ec645ff74466c91a1b4e3ed817f79c2;p=platform%2Fkernel%2Flinux-amlogic.git video: enable pts calculation when hold video state changes [1/1] PD#TV-3999 Problem: dtmb individual channel switching speed is slow, it takes about 16s Solution: enable pts calculation when hold video state changes. Verify: X301 Change-Id: I4c8eda3af3df894d8116461abf63c3dda45c8ce3 Signed-off-by: Rui Wang --- diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 38a9c64..458f60c 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -157,6 +157,7 @@ static bool omx_drop_done; static bool video_start_post; static bool videopeek; static bool nopostvideostart; +static int hold_property_changed; static struct video_frame_detect_s video_frame_detect; static struct timeval time_setomxpts = { .tv_sec = 0, @@ -5390,11 +5391,14 @@ static inline bool vpts_expire(struct vframe_s *cur_vf, systime = timestamp_pcrscr_get(); pts = next_vf->pts; - if (((pts == 0) && (cur_dispbuf != &vf_local)) + if (((pts == 0) && ((cur_dispbuf != &vf_local) + || (hold_property_changed == 1))) || (freerun_mode == FREERUN_DUR)) { pts = timestamp_vpts_get() + (cur_vf ? DUR2PTS(cur_vf->duration) : 0); + if (hold_property_changed == 1) + hold_property_changed = 0; } /* check video PTS discontinuity */ else if ((enable_video_discontinue_report) && @@ -8361,6 +8365,7 @@ static void video_vf_unreg_provider(void) first_frame_toggled = 0; videopeek = 0; nopostvideostart = false; + hold_property_changed = 0; atomic_set(&video_unreg_flag, 1); while (atomic_read(&video_inirq_flag) > 0) @@ -10893,15 +10898,21 @@ static ssize_t video_hold_store(struct class *cla, const char *buf, size_t count) { int r; + unsigned int value; + cur_width = 0; cur_height = 0; if (debug_flag & DEBUG_FLAG_BLACKOUT) pr_info("%s(%s)\n", __func__, buf); - r = kstrtoint(buf, 0, &hold_video); + r = kstrtoint(buf, 0, &value); if (r < 0) return -EINVAL; + if (value == 0 && hold_video == 1) + hold_property_changed = 1; + + hold_video = value; return count; }