Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-24 20:41:16 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-17 14:22:25 +0300
commit40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113 (patch)
tree0fc408f78b9b6934ac351cd4499c07737f8f6a62 /libavformat/oggparseogm.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/oggparseogm.c')
-rw-r--r--libavformat/oggparseogm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index a8319b9dfa..f777790523 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -39,6 +39,7 @@ ogm_header(AVFormatContext *s, int idx)
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + idx;
AVStream *st = s->streams[idx];
+ FFStream *const sti = ffstream(st);
GetByteContext p;
uint64_t time_unit;
uint64_t spu;
@@ -60,7 +61,7 @@ ogm_header(AVFormatContext *s, int idx)
st->codecpar->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag);
st->codecpar->codec_tag = tag;
if (st->codecpar->codec_id == AV_CODEC_ID_MPEG4)
- st->internal->need_parsing = AVSTREAM_PARSE_HEADERS;
+ sti->need_parsing = AVSTREAM_PARSE_HEADERS;
} else if (bytestream2_peek_byte(&p) == 't') {
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codecpar->codec_id = AV_CODEC_ID_TEXT;
@@ -76,7 +77,7 @@ ogm_header(AVFormatContext *s, int idx)
st->codecpar->codec_id = ff_codec_get_id(ff_codec_wav_tags, cid);
// our parser completely breaks AAC in Ogg
if (st->codecpar->codec_id != AV_CODEC_ID_AAC)
- st->internal->need_parsing = AVSTREAM_PARSE_FULL;
+ sti->need_parsing = AVSTREAM_PARSE_FULL;
}
size = bytestream2_get_le32(&p);
@@ -116,7 +117,7 @@ ogm_header(AVFormatContext *s, int idx)
}
// Update internal avctx with changes to codecpar above.
- st->internal->need_context_update = 1;
+ sti->need_context_update = 1;
} else if (bytestream2_peek_byte(&p) == 3) {
bytestream2_skip(&p, 7);
if (bytestream2_get_bytes_left(&p) > 1)