From 40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 24 Aug 2021 19:41:16 +0200 Subject: 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 --- libavformat/cinedec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libavformat/cinedec.c') diff --git a/libavformat/cinedec.c b/libavformat/cinedec.c index f1fae6e5db..c83a4c1471 100644 --- a/libavformat/cinedec.c +++ b/libavformat/cinedec.c @@ -285,13 +285,14 @@ static int cine_read_packet(AVFormatContext *avctx, AVPacket *pkt) { CineDemuxContext *cine = avctx->priv_data; AVStream *st = avctx->streams[0]; + FFStream *const sti = ffstream(st); AVIOContext *pb = avctx->pb; int n, size, ret; - if (cine->pts >= st->internal->nb_index_entries) + if (cine->pts >= sti->nb_index_entries) return AVERROR_EOF; - avio_seek(pb, st->internal->index_entries[cine->pts].pos, SEEK_SET); + avio_seek(pb, sti->index_entries[cine->pts].pos, SEEK_SET); n = avio_rl32(pb); if (n < 8) return AVERROR_INVALIDDATA; -- cgit v1.2.3