diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-24 19:41:16 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-17 13:22:25 +0200 |
commit | 40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113 (patch) | |
tree | 0fc408f78b9b6934ac351cd4499c07737f8f6a62 /libavformat/img2dec.c | |
parent | 9f05b3ba604a30eeb6f5ff877b8b5b5c93a268d7 (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/img2dec.c')
-rw-r--r-- | libavformat/img2dec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index 485444ed31..ad4cc623c8 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -209,7 +209,7 @@ int ff_img_read_header(AVFormatContext *s1) s->is_pipe = 0; else { s->is_pipe = 1; - st->internal->need_parsing = AVSTREAM_PARSE_FULL; + ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL; } if (s->ts_from_file == 2) { @@ -482,7 +482,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt) return AVERROR_EOF; if (s->frame_size > 0) { size[0] = s->frame_size; - } else if (!s1->streams[0]->internal->parser) { + } else if (!ffstream(s1->streams[0])->parser) { size[0] = avio_size(s1->pb); } else { size[0] = 4096; @@ -590,7 +590,7 @@ static int img_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp int index = av_index_search_timestamp(st, timestamp, flags); if(index < 0) return -1; - s1->img_number = st->internal->index_entries[index].pos; + s1->img_number = ffstream(st)->index_entries[index].pos; return 0; } |