amlvideo: fix H264/VP9 adaptiveSkipBack cts errors
authorkunpeng.tang <kunpeng.tang@amlogic.com>
Fri, 13 Apr 2018 04:18:20 +0000 (12:18 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Wed, 18 Apr 2018 05:40:06 +0000 (21:40 -0800)
PD#163463: fix H264/VP9 adaptiveSkipBack cts errors

1.android.media.cts.AdaptivePlaybackTest#testH264_adaptiveSkipBack
2.android.media.cts.AdaptivePlaybackTest#testVP9_adaptiveSkipBack

Change-Id: Ib5f514ceb9a312b2bc608fa8192208dc49be74c9
Signed-off-by: kunpeng.tang <kunpeng.tang@amlogic.com>
drivers/amlogic/media/video_processor/video_dev/amlvideo.c

index a9b4096..0dee419 100644 (file)
@@ -524,9 +524,6 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
        }
        dev->vf->omx_index = dev->frame_num;
 
-       vfq_push(&dev->q_ready, dev->vf);
-       p->index = 0;
-
        if (dev->vf->pts_us64) {
                dev->first_frame = 1;
                pts_us64 = dev->vf->pts_us64;
@@ -536,7 +533,14 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
        } else {
                pts_us64 = dev->last_pts_us64
                        + (DUR2PTS(dev->vf->duration))*100/9;
+               dev->vf->pts = pts_us64*9/100;
+               AMLVIDEO_WARN("pts= %d, dev->vf->duration= %d\n",
+                       dev->vf->pts, (DUR2PTS(dev->vf->duration)));
        }
+
+       vfq_push(&dev->q_ready, dev->vf);
+       p->index = 0;
+
        p->timestamp.tv_sec = pts_us64 >> 32;
        p->timestamp.tv_usec = pts_us64 & 0xFFFFFFFF;
        dev->last_pts_us64 = pts_us64;