ffplay: initialize audio and video pts drift
authorMarton Balint <cus@passwd.hu>
Sat, 6 Oct 2012 17:42:42 +0000 (19:42 +0200)
committerMarton Balint <cus@passwd.hu>
Sun, 21 Oct 2012 15:18:12 +0000 (17:18 +0200)
This makes sensible audio and video clock values even before displaying the
first frame.

Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay.c

index 5c5126b..917883e 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -2677,6 +2677,8 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
 
     is->continue_read_thread = SDL_CreateCond();
 
+    is->audio_current_pts_drift = -av_gettime() / 1000000.0;
+    is->video_current_pts_drift = is->audio_current_pts_drift;
     is->av_sync_type = av_sync_type;
     is->read_tid     = SDL_CreateThread(read_thread, is);
     if (!is->read_tid) {