The branch, master has been updated
via 6d8732f397bfb07f2292e15a61904665abe13ce3 (commit)
from fa72f9a2921556923fa598317db4fcdc3c85ac24 (commit)
- Log -----------------------------------------------------------------
commit 6d8732f397bfb07f2292e15a61904665abe13ce3
Author: James Almer <[email protected]>
AuthorDate: Tue Sep 16 21:45:00 2025 -0300
Commit: James Almer <[email protected]>
CommitDate: Thu Sep 25 23:18:08 2025 -0300
avformat/movenc: clear subsample information on fragment flush
Don't keep around information from a previous traf atom.
Fixes issue #20492.
Signed-off-by: James Almer <[email protected]>
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index bfe76a2034..067d38b14b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6592,6 +6592,9 @@ static int mov_flush_fragment(AVFormatContext *s, int
force)
mov_write_moof_tag(s->pb, mov, moof_tracks, mdat_size);
mov->fragments++;
+ if (track->cenc.aes_ctr)
+ ff_mov_cenc_flush(&track->cenc);
+
avio_wb32(s->pb, mdat_size + 8);
ffio_wfourcc(s->pb, "mdat");
mdat_start = avio_tell(s->pb);
diff --git a/libavformat/movenccenc.c b/libavformat/movenccenc.c
index 32094ebd7b..e5ae11a9c9 100644
--- a/libavformat/movenccenc.c
+++ b/libavformat/movenccenc.c
@@ -629,6 +629,12 @@ int ff_mov_cenc_init(MOVMuxCencContext* ctx, uint8_t*
encryption_key,
return 0;
}
+void ff_mov_cenc_flush(MOVMuxCencContext* ctx)
+{
+ ctx->auxiliary_info_entries = 0;
+ ctx->auxiliary_info_size = 0;
+}
+
void ff_mov_cenc_free(MOVMuxCencContext* ctx)
{
av_aes_ctr_free(ctx->aes_ctr);
diff --git a/libavformat/movenccenc.h b/libavformat/movenccenc.h
index 77a0716c81..f03e2fe6aa 100644
--- a/libavformat/movenccenc.h
+++ b/libavformat/movenccenc.h
@@ -91,6 +91,12 @@ int ff_mov_cenc_avc_write_nal_units(AVFormatContext *s,
MOVMuxCencContext* ctx,
int ff_mov_cenc_av1_write_obus(AVFormatContext *s, MOVMuxCencContext* ctx,
AVIOContext *pb, const AVPacket *pkt);
+
+/**
+ * Clear subsample data. To be called for fragmented output.
+ */
+void ff_mov_cenc_flush(MOVMuxCencContext* ctx);
+
/**
* Write the cenc atoms that should reside inside stbl
*/
-----------------------------------------------------------------------
Summary of changes:
libavformat/movenc.c | 3 +++
libavformat/movenccenc.c | 6 ++++++
libavformat/movenccenc.h | 6 ++++++
3 files changed, 15 insertions(+)
hooks/post-receive
--
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]