Browse Source

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>
tags/n4.3
Raphaël Zumer Vittorio Giovara 6 years ago
parent
commit
d3807467b2
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavformat/ivfenc.c

+ 2
- 1
libavformat/ivfenc.c View 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);
}



Loading…
Cancel
Save