Browse code

Try to more completely update time variables on unpause. Could not notice a differenc in behavior.

Originally committed as revision 21584 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2010/02/01 19:32:17
Showing 1 changed files
... ...
@@ -115,6 +115,7 @@ typedef struct VideoState {
115 115
     int seek_flags;
116 116
     int64_t seek_pos;
117 117
     int64_t seek_rel;
118
+    int read_pause_return;
118 119
     AVFormatContext *ic;
119 120
     int dtg_active_format;
120 121
 
... ...
@@ -991,8 +992,12 @@ static void stream_pause(VideoState *is)
991 991
 {
992 992
     is->paused = !is->paused;
993 993
     if (!is->paused) {
994
-        is->video_current_pts = get_video_clock(is);
994
+        if(is->read_pause_return != AVERROR(ENOSYS)){
995
+            is->video_current_pts = get_video_clock(is);
996
+        }
997
+
995 998
         is->frame_timer += (av_gettime() - is->video_current_pts_time) / 1000000.0;
999
+        is->video_current_pts_time= av_gettime();
996 1000
     }
997 1001
 }
998 1002
 
... ...
@@ -2007,7 +2012,7 @@ static int decode_thread(void *arg)
2007 2007
         if (is->paused != is->last_paused) {
2008 2008
             is->last_paused = is->paused;
2009 2009
             if (is->paused)
2010
-                av_read_pause(ic);
2010
+                is->read_pause_return= av_read_pause(ic);
2011 2011
             else
2012 2012
                 av_read_play(ic);
2013 2013
         }