aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/vocdec.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/vocdec.c
parent9f05b3ba604a30eeb6f5ff877b8b5b5c93a268d7 (diff)
downloadffmpeg-40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113.tar.gz
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/vocdec.c')
-rw-r--r--libavformat/vocdec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/vocdec.c b/libavformat/vocdec.c
index 0bb2bc4fb1..f235d7635b 100644
--- a/libavformat/vocdec.c
+++ b/libavformat/vocdec.c
@@ -73,6 +73,7 @@ static int voc_read_seek(AVFormatContext *s, int stream_index,
{
VocDecContext *voc = s->priv_data;
AVStream *st;
+ FFStream *sti;
int index;
if (s->nb_streams < 1) {
@@ -81,16 +82,17 @@ static int voc_read_seek(AVFormatContext *s, int stream_index,
}
st = s->streams[stream_index];
+ sti = ffstream(st);
index = av_index_search_timestamp(st, timestamp, flags);
- if (index >= 0 && index < st->internal->nb_index_entries - 1) {
- AVIndexEntry *e = &st->internal->index_entries[index];
+ if (index >= 0 && index < sti->nb_index_entries - 1) {
+ const AVIndexEntry *const e = &sti->index_entries[index];
avio_seek(s->pb, e->pos, SEEK_SET);
voc->pts = e->timestamp;
voc->remaining_size = e->size;
return 0;
- } else if (st->internal->nb_index_entries && st->internal->index_entries[0].timestamp <= timestamp) {
- AVIndexEntry *e = &st->internal->index_entries[st->internal->nb_index_entries - 1];
+ } else if (sti->nb_index_entries && sti->index_entries[0].timestamp <= timestamp) {
+ const AVIndexEntry *const e = &sti->index_entries[sti->nb_index_entries - 1];
// prepare context for seek_frame_generic()
voc->pts = e->timestamp;
voc->remaining_size = e->size;