summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorRudolf Polzer <divverent@xonotic.org>2013-06-09 16:37:13 +0200
committerRudolf Polzer <divverent@xonotic.org>2013-06-09 16:37:13 +0200
commitfc438061e865d9aeca686500b09339cbc330c66f (patch)
treea7a90dd883ec763077218756f90e7999ade7a253 /video
parent3600bf348f09108782c600729482946946d84f8f (diff)
downloadmpv-fc438061e865d9aeca686500b09339cbc330c66f.tar.bz2
mpv-fc438061e865d9aeca686500b09339cbc330c66f.tar.xz
encoding: fix -oneverdrop logic when -omaxfps is used
Not that anyone should ever do this...
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_lavc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index 5a333a5799..c35b18d749 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -395,12 +395,15 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
}
// never-drop mode
- if (ectx->options->neverdrop && frameipts <= vc->lastipts) {
+ if (ectx->options->neverdrop) {
int64_t step = vc->mindeltapts ? vc->mindeltapts : 1;
- mp_msg(MSGT_ENCODE, MSGL_INFO, "vo-lavc: -oneverdrop increased pts by %d\n",
- (int) (vc->lastipts - frameipts + step));
- frameipts = vc->lastipts + step;
- vc->lastpts = frameipts * timeunit - encode_lavc_getoffset(ectx, vc->stream);
+ if (frameipts < vc->lastipts + step) {
+ mp_msg(MSGT_ENCODE, MSGL_INFO,
+ "vo-lavc: -oneverdrop increased pts by %d\n",
+ (int) (vc->lastipts - frameipts + step));
+ frameipts = vc->lastipts + step;
+ vc->lastpts = frameipts * timeunit - encode_lavc_getoffset(ectx, vc->stream);
+ }
}
if (vc->lastipts != MP_NOPTS_VALUE) {