Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-24 20:41:16 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-17 14:22:25 +0300
commit40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113 (patch)
tree0fc408f78b9b6934ac351cd4499c07737f8f6a62 /libavformat/asfdec_o.c
parent9f05b3ba604a30eeb6f5ff877b8b5b5c93a268d7 (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/asfdec_o.c')
-rw-r--r--libavformat/asfdec_o.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 0a3af53a01..fb614d42de 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -1513,13 +1513,15 @@ static int asf_read_seek(AVFormatContext *s, int stream_index,
int64_t timestamp, int flags)
{
ASFContext *asf = s->priv_data;
+ AVStream *const st = s->streams[stream_index];
+ FFStream *const sti = ffstream(st);
int idx, ret;
- if (s->streams[stream_index]->internal->nb_index_entries && asf->is_simple_index) {
- idx = av_index_search_timestamp(s->streams[stream_index], timestamp, flags);
- if (idx < 0 || idx >= s->streams[stream_index]->internal->nb_index_entries)
+ if (sti->nb_index_entries && asf->is_simple_index) {
+ idx = av_index_search_timestamp(st, timestamp, flags);
+ if (idx < 0 || idx >= sti->nb_index_entries)
return AVERROR_INVALIDDATA;
- avio_seek(s->pb, s->streams[stream_index]->internal->index_entries[idx].pos, SEEK_SET);
+ avio_seek(s->pb, sti->index_entries[idx].pos, SEEK_SET);
} else {
if ((ret = ff_seek_frame_binary(s, stream_index, timestamp, flags)) < 0)
return ret;