diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-24 14:58:07 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-17 04:58:34 +0200 |
commit | fed02825081bd6441f865c9cfcf50e384b2392f5 (patch) | |
tree | b42f4b433b1652e4ad65bc0b5066fe3e80d5662f /libavformat/vqf.c | |
parent | dfbf41775cb58a9218a8b39b0dc6fd8de3f1ab35 (diff) | |
download | ffmpeg-fed02825081bd6441f865c9cfcf50e384b2392f5.tar.gz |
avformat: Avoid allocation for AVFormatInternal
Do this by allocating AVFormatContext together with the data that is
currently in AVFormatInternal; or rather: Put AVFormatContext at the
beginning of a new structure called FFFormatContext (which encompasses
more than just the internal fields and is a proper context in its own
right, hence the name) and remove AVFormatInternal altogether.
The biggest simplifications occured in avformat_alloc_context(), where
one can now simply call avformat_free_context() in case of errors.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/vqf.c')
-rw-r--r-- | libavformat/vqf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/vqf.c b/libavformat/vqf.c index 08dba858b4..1810fca8b9 100644 --- a/libavformat/vqf.c +++ b/libavformat/vqf.c @@ -280,7 +280,7 @@ static int vqf_read_seek(AVFormatContext *s, st->internal->cur_dts = av_rescale(pos, st->time_base.den, st->codecpar->bit_rate * (int64_t)st->time_base.num); - if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + s->internal->data_offset, SEEK_SET)) < 0) + if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + ffformatcontext(s)->data_offset, SEEK_SET)) < 0) return ret; c->remaining_bits = -7 - ((pos-7)&7); |