1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-03 13:32:16 +00:00

encode: write 2-pass stats only per-packet

The stats were retrieved and written on every encode call, instead of
every encode call that actually returned a packet. ffmpeg.c also does it
this way, so it must be "more correct". Fixes 2-pass encoding.
This commit is contained in:
wm4 2014-04-11 00:08:32 +02:00
parent 856d2c2491
commit 04bcb539fd

View File

@ -273,7 +273,8 @@ static int encode_video(struct vo *vo, AVFrame *frame, AVPacket *packet)
frame->pts * (double) vc->stream->codec->time_base.num /
(double) vc->stream->codec->time_base.den, size);
encode_lavc_write_stats(vo->encode_lavc_ctx, vc->stream);
if (got_packet)
encode_lavc_write_stats(vo->encode_lavc_ctx, vc->stream);
return size;
}
}