summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.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/mpeg.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/mpeg.c')
-rw-r--r--libavformat/mpeg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index a7874cdae8..ca15d9f241 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -478,6 +478,7 @@ static int mpegps_read_packet(AVFormatContext *s,
{
MpegDemuxContext *m = s->priv_data;
AVStream *st;
+ FFStream *sti;
int len, startcode, i, es_type, ret;
int pcm_dvd = 0;
int request_probe= 0;
@@ -614,6 +615,7 @@ skip:
st = avformat_new_stream(s, NULL);
if (!st)
goto skip;
+ sti = ffstream(st);
st->id = startcode;
st->codecpar->codec_type = type;
st->codecpar->codec_id = codec_id;
@@ -623,8 +625,8 @@ skip:
st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
st->codecpar->sample_rate = 8000;
}
- st->internal->request_probe = request_probe;
- st->internal->need_parsing = AVSTREAM_PARSE_FULL;
+ sti->request_probe = request_probe;
+ sti->need_parsing = AVSTREAM_PARSE_FULL;
found:
if (st->discard >= AVDISCARD_ALL)