]> git.sesse.net Git - ffmpeg/commitdiff
avformat/ivfenc: Change the length fields to 32 bits
authorRaphaël Zumer <rzumer@tebako.net>
Wed, 2 Oct 2019 13:04:59 +0000 (09:04 -0400)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 9 Oct 2019 01:44:41 +0000 (21:44 -0400)
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>
libavformat/ivfenc.c

index ae461a872b678010eeffa2f467d470eb14b4399f..eb70421c44a46b93cd6074e7051289f76d562ccd 100644 (file)
@@ -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);
     }