Restore frametime on seek.
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Wed, 30 Aug 2017 20:16:40 +0000 (20:16 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Wed, 30 Aug 2017 20:16:40 +0000 (20:16 +0000)
Fixes issue #2331.

git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@37953 b3059339-0415-0410-9bf9-f77b7e298cf2

mplayer.c

index c620eb5..754fdd0 100644 (file)
--- a/mplayer.c
+++ b/mplayer.c
@@ -3833,6 +3833,7 @@ goto_enable_cache:
                         } else {
                             frame_time = mpctx->sh_video->frametime;
                         }
+                        // mark as last frame. Note: needs to be reset on seeking
                         mpctx->sh_video->frametime = -1;
                         mpctx->sh_video->endpts = MP_NOPTS_VALUE;
                     }
@@ -4032,6 +4033,9 @@ goto_enable_cache:
                     }
                 }
 
+                // reset last frame marker
+                if (mpctx->sh_video->frametime < 0)
+                    mpctx->sh_video->frametime = 1.0f / mpctx->sh_video->fps;
                 rel_seek_secs = 0;
                 abs_seek_pos  = 0;
                 loop_seek     = 0;