From: Andriy Gelman <andriy.gel...@gmail.com> Currently, header_count is used to store both the elision header count and the header repetition count (number of times headers have been written to output). Fix this by using a separate variable to store repetition count.
Signed-off-by: Andriy Gelman <andriy.gel...@gmail.com> --- libavformat/nut.h | 3 ++- libavformat/nutenc.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/nut.h b/libavformat/nut.h index a4409ee23d..a990d3832e 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -103,7 +103,8 @@ typedef struct NUTContext { unsigned int time_base_count; int64_t last_syncpoint_pos; int64_t last_resync_pos; - int header_count; + int header_count; // elision header count + int header_rep_count; // number of times headers written AVRational *time_base; struct AVTreeNode *syncpoints; int sp_count; diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 1dcb2be1b1..87adef6f7e 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -684,7 +684,7 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc) } nut->last_syncpoint_pos = INT_MIN; - nut->header_count++; + nut->header_rep_count++; ret = 0; fail: @@ -988,7 +988,7 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt) data_size += sm_size; } - if (1LL << (20 + 3 * nut->header_count) <= avio_tell(bc)) + if (1LL << (20 + 3 * nut->header_rep_count) <= avio_tell(bc)) write_headers(s, bc); if (key_frame && !(nus->last_flags & FLAG_KEY)) -- 2.28.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".