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>
This commit is contained in:
Andreas Rheinhardt
2021-08-24 19:41:16 +02:00
parent 9f05b3ba60
commit 40bdd8cc05
87 changed files with 745 additions and 606 deletions

View File

@@ -991,10 +991,10 @@ static int seg_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)
if (oc->oformat->check_bitstream) {
int ret = oc->oformat->check_bitstream(oc, pkt);
if (ret == 1) {
AVStream *st = s->streams[pkt->stream_index];
AVStream *ost = oc->streams[pkt->stream_index];
st->internal->bsfc = ost->internal->bsfc;
ost->internal->bsfc = NULL;
FFStream *const sti = ffstream( s->streams[pkt->stream_index]);
FFStream *const osti = ffstream(oc->streams[pkt->stream_index]);
sti->bsfc = osti->bsfc;
osti->bsfc = NULL;
}
return ret;
}