diff options
author | wm4 <wm4@nowhere> | 2014-04-11 00:08:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-11 00:08:32 +0200 |
commit | 04bcb539fdd486bf00687f3b15a2d20687328227 (patch) | |
tree | c96c16bc3d7187efcee5de295fb8f86533d08dc7 /video | |
parent | 856d2c24910225a5d9c4f0088fda7b4dd53420aa (diff) |
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.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo_lavc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c index 84f09a161f..9617e0f989 100644 --- a/video/out/vo_lavc.c +++ b/video/out/vo_lavc.c @@ -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; } } |