encoding: fix -oneverdrop logic when -omaxfps is used

Not that anyone should ever do this...
This commit is contained in:
Rudolf Polzer 2013-06-09 16:37:13 +02:00
parent 3600bf348f
commit fc438061e8
1 changed files with 8 additions and 5 deletions

View File

@ -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) {