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 053b2d18fa avcodec/aacenc: export discard padding side data when needed
053b2d18fa is described below
commit 053b2d18fa6714e927dbe8afcf5bc6fd9a9c6a05
Author: James Almer <[email protected]>
AuthorDate: Wed Jul 1 17:00:42 2026 +0000
Commit: James Almer <[email protected]>
CommitDate: Thu Jul 2 02:57:29 2026 +0000
avcodec/aacenc: export discard padding side data when needed
This is in line with other encoders, and is needed by the matroska muxer
to properly signal end trimming samples.
gaplessenc-pcm-to-mov-aac changes as the mov muxer now uses this information
when writing the edit list, so the shorter frame duration is not needed.
Signed-off-by: James Almer <[email protected]>
---
libavcodec/aacenc.c | 9 +++++++++
tests/ref/fate/gaplessenc-pcm-to-mov-aac | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index d5abb0aa77..a4243350eb 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -1415,6 +1415,15 @@ static int aac_encode_frame(AVCodecContext *avctx,
AVPacket *avpkt,
ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
&avpkt->duration);
+ int discard_padding = avctx->frame_size - ff_samples_from_time_base(avctx,
avpkt->duration);
+ if (discard_padding > 0) {
+ uint8_t *side_data =
+ av_packet_new_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, 10);
+ if (!side_data)
+ return AVERROR(ENOMEM);
+ AV_WL32(side_data + 4, discard_padding);
+ }
+
avpkt->flags |= AV_PKT_FLAG_KEY;
*got_packet_ptr = 1;
diff --git a/tests/ref/fate/gaplessenc-pcm-to-mov-aac
b/tests/ref/fate/gaplessenc-pcm-to-mov-aac
index 073f2ec0c1..2c2429e661 100644
--- a/tests/ref/fate/gaplessenc-pcm-to-mov-aac
+++ b/tests/ref/fate/gaplessenc-pcm-to-mov-aac
@@ -22,7 +22,7 @@ packet|pts=524288|dts=524288|duration=1024|flags=K__
packet|pts=525312|dts=525312|duration=1024|flags=K__
packet|pts=526336|dts=526336|duration=1024|flags=K__
packet|pts=527360|dts=527360|duration=1024|flags=K__
-packet|pts=528384|dts=528384|duration=816|flags=K__|side_datum/skip_samples:side_data_type=Skip
Samples|side_datum/skip_samples:skip_samples=0|side_datum/skip_samples:discard_padding=208|side_datum/skip_samples:skip_reason=0|side_datum/skip_samples:discard_reason=0
+packet|pts=528384|dts=528384|duration=1024|flags=K__|side_datum/skip_samples:side_data_type=Skip
Samples|side_datum/skip_samples:skip_samples=0|side_datum/skip_samples:discard_padding=208|side_datum/skip_samples:skip_reason=0|side_datum/skip_samples:discard_reason=0
stream|nb_read_packets=518
frame|pts=0|pkt_dts=0|best_effort_timestamp=0|nb_samples=1024
frame|pts=1024|pkt_dts=1024|best_effort_timestamp=1024|nb_samples=1024
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]