diff --git a/ffplay.c b/ffplay.c
index 260fe5fdc8b694201c7f7e115d841df3f925857d..593a6f73b9230cf589a020965019e276fcac0fc1 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1026,8 +1026,7 @@ static double compute_frame_delay(double frame_current_pts, VideoState *is)
          is->av_sync_type == AV_SYNC_EXTERNAL_CLOCK)) {
         /* if video is slave, we try to correct big delays by
            duplicating or deleting a frame */
-        ref_clock = get_master_clock(is);
-        diff = frame_current_pts - ref_clock;
+        diff = get_video_clock(is) - get_master_clock(is);
 
         /* skip or repeat frame. We take into account the
            delay to compute the threshold. I still don't know