media: recover calculated disp pts for video
authorshihong.zheng <shihong.zheng@amlogic.com>
Sat, 4 Nov 2017 06:06:37 +0000 (14:06 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 10 Nov 2017 06:14:50 +0000 (23:14 -0700)
PD#153240: add disp pts in vf for some unstable pts

Change-Id: I1d4cfd04c94feafac109bd69be3bd422aca3d8bf
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
drivers/amlogic/media/video_sink/video.c
include/linux/amlogic/media/vfm/vframe.h

index 7973a49..2e10961 100644 (file)
@@ -895,7 +895,15 @@ void safe_disble_videolayer(void)
 /*********************************************************/
 static inline struct vframe_s *video_vf_peek(void)
 {
-       return vf_peek(RECEIVER_NAME);
+       struct vframe_s *vf = vf_peek(RECEIVER_NAME);
+
+       if (vf && vf->disp_pts && vf->disp_pts_us64) {
+               vf->pts = vf->disp_pts;
+               vf->pts_us64 = vf->disp_pts_us64;
+               vf->disp_pts = 0;
+               vf->disp_pts_us64 = 0;
+       }
+       return vf;
 }
 
 static inline struct vframe_s *video_vf_get(void)
@@ -905,6 +913,12 @@ static inline struct vframe_s *video_vf_get(void)
        vf = vf_get(RECEIVER_NAME);
 
        if (vf) {
+               if (vf->disp_pts && vf->disp_pts_us64) {
+                       vf->pts = vf->disp_pts;
+                       vf->pts_us64 = vf->disp_pts_us64;
+                       vf->disp_pts = 0;
+                       vf->disp_pts_us64 = 0;
+               }
                video_notify_flag |= VIDEO_NOTIFY_PROVIDER_GET;
                atomic_set(&vf->use_cnt, 1);
                /*always to 1,for first get from vfm provider */
index 0aa2f38..a0b9ab6 100644 (file)
@@ -237,6 +237,8 @@ struct vframe_s {
        u32 duration_pulldown;
        u32 pts;
        u64 pts_us64;
+       u32 disp_pts;
+       u64 disp_pts_us64;
        u32 flag;
 
        u32 canvas0Addr;