aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorRomain Beauxis <romain.beauxis@gmail.com>2025-05-24 13:14:05 -0500
committerMichael Niedermayer <michael@niedermayer.cc>2025-05-30 22:07:10 +0200
commitba3d4c2ba2b85ccd35227b917c46c4eb0e8c39aa (patch)
tree6edd53b7c909e835b09fd8f5f81723c468abee17 /libavformat
parent791a333a0ea5aeee1bea12065b407ba442ac59b4 (diff)
downloadffmpeg-ba3d4c2ba2b85ccd35227b917c46c4eb0e8c39aa.tar.gz
libavformat/oggdec.{c, h}: Add new_extradata, use it to pass extradata to the next decoded packet.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/oggdec.c11
-rw-r--r--libavformat/oggdec.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 5557eb4a14..da3ef815db 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -77,6 +77,7 @@ static void free_stream(AVFormatContext *s, int i)
av_freep(&stream->private);
av_freep(&stream->new_metadata);
+ av_freep(&stream->new_extradata);
}
//FIXME We could avoid some structure duplication
@@ -888,6 +889,16 @@ retry:
os->new_metadata_size = 0;
}
+ if (os->new_extradata) {
+ ret = av_packet_add_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
+ os->new_extradata, os->new_extradata_size);
+ if (ret < 0)
+ return ret;
+
+ os->new_extradata = NULL;
+ os->new_extradata_size = 0;
+ }
+
return psize;
}
diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index bc670d0f1e..5083de646c 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -94,6 +94,8 @@ struct ogg_stream {
int end_trimming; ///< set the number of packets to drop from the end
uint8_t *new_metadata;
size_t new_metadata_size;
+ uint8_t *new_extradata;
+ size_t new_extradata_size;
void *private;
};