summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Zumer <rzumer@tebako.net>2019-10-01 13:40:55 -0400
committerVittorio Giovara <vittorio.giovara@gmail.com>2019-10-08 21:44:36 -0400
commiteeb1c515a867489fd4fab4c7c1636176e602976d (patch)
treef43e652ff2e4a1425b757948ef80da699b518485
parent971c890c056d600a636df85f9b5e4f09fb780f41 (diff)
avformat/ivfenc: Comment the length field encoding process
Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
-rw-r--r--libavformat/ivfenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c
index adf72117e9..ae461a872b 100644
--- a/libavformat/ivfenc.c
+++ b/libavformat/ivfenc.c
@@ -53,7 +53,7 @@ static int ivf_write_header(AVFormatContext *s)
avio_wl16(pb, par->height);
avio_wl32(pb, s->streams[0]->time_base.den);
avio_wl32(pb, s->streams[0]->time_base.num);
- avio_wl64(pb, 0xFFFFFFFFFFFFFFFFULL);
+ avio_wl64(pb, 0xFFFFFFFFFFFFFFFFULL); // length is overwritten at the end of muxing
return 0;
}
@@ -83,6 +83,7 @@ static int ivf_write_trailer(AVFormatContext *s)
size_t end = avio_tell(pb);
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_seek(pb, end, SEEK_SET);
}