diff options
author | wm4 <wm4@nowhere> | 2014-04-11 00:08:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-17 22:58:48 +0200 |
commit | 0e2fe55fded99bff4f9ec7a01318b864dc1737f6 (patch) | |
tree | 113c77f91b14b74836ad59c8558a5c21815c172b /video | |
parent | 22cfb48b5292e563f5586048598c5d25a629326e (diff) | |
download | mpv-0e2fe55fded99bff4f9ec7a01318b864dc1737f6.tar.bz2 mpv-0e2fe55fded99bff4f9ec7a01318b864dc1737f6.tar.xz |
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 c0b317da94..fcd1d4b487 100644 --- a/video/out/vo_lavc.c +++ b/video/out/vo_lavc.c @@ -267,7 +267,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; } } |