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/matroskaenc.c | |
parent | dfbf41775cb58a9218a8b39b0dc6fd8de3f1ab35 (diff) |
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/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 6e34243f6b..b900937e82 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1253,7 +1253,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv, // if there is no mkv-specific codec ID, use VFW mode put_ebml_string(pb, MATROSKA_ID_CODECID, "V_MS/VFW/FOURCC"); track->write_dts = 1; - s->internal->avoid_negative_ts_use_pts = 0; + ffformatcontext(s)->avoid_negative_ts_use_pts = 0; } subinfo = start_ebml_master(pb, MATROSKA_ID_TRACKVIDEO, 0); @@ -2653,6 +2653,7 @@ static uint64_t mkv_get_uid(const mkv_track *tracks, int i, AVLFG *c) static int mkv_init(struct AVFormatContext *s) { + FFFormatContext *const si = ffformatcontext(s); MatroskaMuxContext *mkv = s->priv_data; AVLFG c; unsigned nb_tracks = 0; @@ -2674,7 +2675,7 @@ static int mkv_init(struct AVFormatContext *s) if (s->avoid_negative_ts < 0) { s->avoid_negative_ts = 1; - s->internal->avoid_negative_ts_use_pts = 1; + si->avoid_negative_ts_use_pts = 1; } if (!strcmp(s->oformat->name, "webm")) { |