avformat/ivfenc: Comment the length field encoding process

Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
This commit is contained in:
Raphaël Zumer 2019-10-01 13:40:55 -04:00 committed by Vittorio Giovara
parent 971c890c05
commit eeb1c515a8
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}