From fed02825081bd6441f865c9cfcf50e384b2392f5 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 24 Aug 2021 14:58:07 +0200 Subject: 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 --- libavformat/yop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/yop.c') diff --git a/libavformat/yop.c b/libavformat/yop.c index 8ecdc654a9..f65e4f8b16 100644 --- a/libavformat/yop.c +++ b/libavformat/yop.c @@ -187,7 +187,7 @@ static int yop_read_seek(AVFormatContext *s, int stream_index, if (!stream_index) return -1; - pos_min = s->internal->data_offset; + pos_min = ffformatcontext(s)->data_offset; pos_max = avio_size(s->pb) - yop->frame_size; frame_count = (pos_max - pos_min) / yop->frame_size; -- cgit v1.2.3