summaryrefslogtreecommitdiff
path: root/libavformat/ivfenc.c
diff options
context:
space:
mode:
authorRaphaël Zumer <rzumer@tebako.net>2019-10-02 09:04:59 -0400
committerVittorio Giovara <vittorio.giovara@gmail.com>2019-10-08 21:44:41 -0400
commitd3807467b2587ea720f32933d44b9dac5ecda66b (patch)
tree64295125ec611133fa8f664947b1753c585ac1cb /libavformat/ivfenc.c
parenteeb1c515a867489fd4fab4c7c1636176e602976d (diff)
downloadffmpeg-d3807467b2587ea720f32933d44b9dac5ecda66b.tar.gz
avformat/ivfenc: Change the length fields to 32 bits
There is no change in the encoded bitstream, but this ensures that the written field length is consistent with the reference implementation. Unused bytes are zeroed out for backwards compatibility. Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
Diffstat (limited to 'libavformat/ivfenc.c')
-rw-r--r--libavformat/ivfenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c
index ae461a872b..eb70421c44 100644
--- a/libavformat/ivfenc.c
+++ b/libavformat/ivfenc.c
@@ -84,7 +84,8 @@ static int ivf_write_trailer(AVFormatContext *s)
avio_seek(pb, 24, SEEK_SET);
// overwrite the "length" field (duration)
- avio_wl64(pb, ctx->frame_cnt * ctx->sum_delta_pts / (ctx->frame_cnt - 1));
+ avio_wl32(pb, ctx->frame_cnt * ctx->sum_delta_pts / (ctx->frame_cnt - 1));
+ avio_wl32(pb, 0); // zero out unused bytes
avio_seek(pb, end, SEEK_SET);
}