aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-01-07 18:30:57 -0300
committerJames Almer <jamrial@gmail.com>2024-01-20 09:19:21 -0300
commit9da0594f1d63be980dd8e8a7f7568a051ea39782 (patch)
tree082b2d0e5cf522e2940a5a1cc3e429fb48e2e74b
parent3423a680bf9d5160fa8e4c80364958493588b107 (diff)
downloadffmpeg-9da0594f1d63be980dd8e8a7f7568a051ea39782.tar.gz
avformat/iamfenc: don't write empty packets
And return an error if they are not side data only packets. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/iamfenc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/iamfenc.c b/libavformat/iamfenc.c
index 1de416b663..a02f84035a 100644
--- a/libavformat/iamfenc.c
+++ b/libavformat/iamfenc.c
@@ -278,6 +278,16 @@ static int iamf_write_packet(AVFormatContext *s, AVPacket *pkt)
int dyn_size, type = st->id <= 17 ? st->id + IAMF_OBU_IA_AUDIO_FRAME_ID0 : IAMF_OBU_IA_AUDIO_FRAME;
int ret;
+ if (!pkt->size) {
+ uint8_t *new_extradata = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, NULL);
+
+ if (!new_extradata)
+ return AVERROR_INVALIDDATA;
+
+ // TODO: update FLAC Streaminfo on seekable output
+ return 0;
+ }
+
if (s->nb_stream_groups && st->id == c->first_stream_id) {
AVIAMFParamDefinition *mix =
(AVIAMFParamDefinition *)av_packet_get_side_data(pkt, AV_PKT_DATA_IAMF_MIX_GAIN_PARAM, NULL);