This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 627da1111c libavformat/movenc: Uses dynamic buffers for fragmented
chunks
627da1111c is described below
commit 627da1111c9d8ebf8a3a190a164cd502b99a09cb
Author: Anthony Bajoua <[email protected]>
AuthorDate: Fri Jan 30 13:43:03 2026 -0800
Commit: Anthony Bajoua <[email protected]>
CommitDate: Wed Feb 4 18:45:15 2026 -0800
libavformat/movenc: Uses dynamic buffers for fragmented chunks
---
libavformat/movenc.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 802c37fc4a..fe6b259561 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6391,7 +6391,7 @@ static int
mov_flush_fragment_interleaving(AVFormatContext *s, MOVTrack *track)
offset = avio_tell(mov->mdat_buf);
avio_write(mov->mdat_buf, buf, buf_size);
- ffio_free_dyn_buf(&track->mdat_buf);
+ ffio_reset_dyn_buf(track->mdat_buf);
for (i = track->entries_flushed; i < track->entry; i++)
track->cluster[i].pos += offset;
@@ -6596,7 +6596,7 @@ static int mov_flush_fragment(AVFormatContext *s, int
force)
avio_wb32(s->pb, buf_size + 8);
ffio_wfourcc(s->pb, "mdat");
avio_write(s->pb, buf, buf_size);
- ffio_free_dyn_buf(&mov->mdat_buf);
+ ffio_reset_dyn_buf(mov->mdat_buf);
if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX)
mov->reserved_header_pos = avio_tell(s->pb);
@@ -6683,17 +6683,16 @@ static int mov_flush_fragment(AVFormatContext *s, int
force)
if (!mov->frag_interleave) {
if (!track->mdat_buf)
continue;
- buf_size = avio_close_dyn_buf(track->mdat_buf, &buf);
- track->mdat_buf = NULL;
+ buf_size = avio_get_dyn_buf(track->mdat_buf, &buf);
+ avio_write(s->pb, buf, buf_size);
+ ffio_reset_dyn_buf(track->mdat_buf);
} else {
if (!mov->mdat_buf)
continue;
- buf_size = avio_close_dyn_buf(mov->mdat_buf, &buf);
- mov->mdat_buf = NULL;
+ buf_size = avio_get_dyn_buf(mov->mdat_buf, &buf);
+ avio_write(s->pb, buf, buf_size);
+ ffio_reset_dyn_buf(mov->mdat_buf);
}
-
- avio_write(s->pb, buf, buf_size);
- av_free(buf);
}
mov->mdat_size = 0;
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]