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/rl2.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/rl2.c')
-rw-r--r-- | libavformat/rl2.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/rl2.c b/libavformat/rl2.c index 8b6a7f1827..6a559c7294 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -237,9 +237,10 @@ static int rl2_read_packet(AVFormatContext *s, /** check if there is a valid video or audio entry that can be used */ for(i=0; i<s->nb_streams; i++){ - if(rl2->index_pos[i] < s->streams[i]->internal->nb_index_entries - && s->streams[i]->internal->index_entries[ rl2->index_pos[i] ].pos < pos){ - sample = &s->streams[i]->internal->index_entries[ rl2->index_pos[i] ]; + const FFStream *const sti = ffstream(s->streams[i]); + if (rl2->index_pos[i] < sti->nb_index_entries + && sti->index_entries[ rl2->index_pos[i] ].pos < pos) { + sample = &sti->index_entries[ rl2->index_pos[i] ]; pos= sample->pos; stream_id= i; } @@ -283,7 +284,7 @@ static int rl2_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp return -1; rl2->index_pos[stream_index] = index; - timestamp = st->internal->index_entries[index].timestamp; + timestamp = ffstream(st)->index_entries[index].timestamp; for(i=0; i < s->nb_streams; i++){ AVStream *st2 = s->streams[i]; |