summaryrefslogtreecommitdiff
path: root/libavformat/rmdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-24 19:41:16 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-17 13:22:25 +0200
commit40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113 (patch)
tree0fc408f78b9b6934ac351cd4499c07737f8f6a62 /libavformat/rmdec.c
parent9f05b3ba604a30eeb6f5ff877b8b5b5c93a268d7 (diff)
avformat: Avoid allocation for AVStreamInternal
Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r--libavformat/rmdec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 0aaebb86d7..d4ba6622a6 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -122,6 +122,7 @@ void ff_rm_free_rmstream (RMStream *rms)
static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
AVStream *st, RMStream *ast, int read_all)
{
+ FFStream *const sti = ffstream(st);
char buf[256];
uint32_t version;
int ret;
@@ -202,7 +203,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
switch (st->codecpar->codec_id) {
case AV_CODEC_ID_AC3:
- st->internal->need_parsing = AVSTREAM_PARSE_FULL;
+ sti->need_parsing = AVSTREAM_PARSE_FULL;
break;
case AV_CODEC_ID_RA_288:
st->codecpar->extradata_size= 0;
@@ -211,7 +212,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
st->codecpar->block_align = coded_framesize;
break;
case AV_CODEC_ID_COOK:
- st->internal->need_parsing = AVSTREAM_PARSE_HEADERS;
+ sti->need_parsing = AVSTREAM_PARSE_HEADERS;
case AV_CODEC_ID_ATRAC3:
case AV_CODEC_ID_SIPR:
if (read_all) {
@@ -235,7 +236,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
return -1;
}
st->codecpar->block_align = ff_sipr_subpk_size[flavor];
- st->internal->need_parsing = AVSTREAM_PARSE_FULL_RAW;
+ sti->need_parsing = AVSTREAM_PARSE_FULL_RAW;
} else {
if(sub_packet_size <= 0){
av_log(s, AV_LOG_ERROR, "sub_packet_size is invalid\n");
@@ -388,7 +389,7 @@ int ff_rm_read_mdpr_codecdata(AVFormatContext *s, AVIOContext *pb,
avio_skip(pb, 2); // looks like bits per sample
avio_skip(pb, 4); // always zero?
st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
- st->internal->need_parsing = AVSTREAM_PARSE_TIMESTAMPS;
+ ffstream(st)->need_parsing = AVSTREAM_PARSE_TIMESTAMPS;
fps = avio_rb32(pb);
if ((ret = rm_read_extradata(s, pb, st->codecpar, codec_data_size - (avio_tell(pb) - codec_pos))) < 0)