mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-16 03:50:05 +01:00
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>
This commit is contained in:
@@ -3070,7 +3070,7 @@ static int mpegts_read_header(AVFormatContext *s)
|
||||
int64_t pos, probesize = s->probesize;
|
||||
int64_t seekback = FFMAX(s->probesize, (int64_t)ts->resync_size + PROBE_PACKET_MAX_BUF);
|
||||
|
||||
s->internal->prefer_codec_framerate = 1;
|
||||
ffformatcontext(s)->prefer_codec_framerate = 1;
|
||||
|
||||
if (ffio_ensure_seekback(pb, seekback) < 0)
|
||||
av_log(s, AV_LOG_WARNING, "Failed to allocate buffers for seekback\n");
|
||||
|
||||
Reference in New Issue
Block a user