Simplify get_video_clock()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 1 Feb 2010 09:26:30 +0000 (09:26 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 1 Feb 2010 09:26:30 +0000 (09:26 +0000)
Originally committed as revision 21582 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffplay.c

index b70589e..097a82c 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -938,13 +938,11 @@ static double get_audio_clock(VideoState *is)
 /* get the current video clock value */
 static double get_video_clock(VideoState *is)
 {
-    double delta;
     if (is->paused) {
-        delta = 0;
+        return is->video_current_pts;
     } else {
-        delta = (av_gettime() - is->video_current_pts_time) / 1000000.0;
+        return is->video_current_pts + (av_gettime() - is->video_current_pts_time) / 1000000.0;
     }
-    return is->video_current_pts + delta;
 }
 
 /* get the current external clock value */