summaryrefslogtreecommitdiff
path: root/libavformat/serdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-24 14:58:07 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-17 04:58:34 +0200
commitfed02825081bd6441f865c9cfcf50e384b2392f5 (patch)
treeb42f4b433b1652e4ad65bc0b5066fe3e80d5662f /libavformat/serdec.c
parentdfbf41775cb58a9218a8b39b0dc6fd8de3f1ab35 (diff)
downloadffmpeg-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/serdec.c')
-rw-r--r--libavformat/serdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/serdec.c b/libavformat/serdec.c
index fa2de32fd5..fe185cabd9 100644
--- a/libavformat/serdec.c
+++ b/libavformat/serdec.c
@@ -110,7 +110,7 @@ static int ser_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR_EOF;
ret = av_get_packet(s->pb, pkt, s->packet_size);
- pkt->pts = pkt->dts = (pkt->pos - s->internal->data_offset) / s->packet_size;
+ pkt->pts = pkt->dts = (pkt->pos - ffformatcontext(s)->data_offset) / s->packet_size;
pkt->stream_index = 0;
if (ret < 0)