diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-24 19:41:16 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-17 13:22:25 +0200 |
commit | 40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113 (patch) | |
tree | 0fc408f78b9b6934ac351cd4499c07737f8f6a62 /libavformat/dump.c | |
parent | 9f05b3ba604a30eeb6f5ff877b8b5b5c93a268d7 (diff) |
avformat: Avoid allocation for AVStreamInternal
Do this by allocating AVStream together with the data that is
currently in AVStreamInternal; or rather: Put AVStream at the
beginning of a new structure called FFStream (which encompasses
more than just the internal fields and is a proper context in its own
right, hence the name) and remove AVStreamInternal altogether.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/dump.c')
-rw-r--r-- | libavformat/dump.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c index cf892de107..4824965ee9 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -508,6 +508,7 @@ static void dump_stream_format(const AVFormatContext *ic, int i, char buf[256]; int flags = (is_output ? ic->oformat->flags : ic->iformat->flags); const AVStream *st = ic->streams[i]; + const FFStream *const sti = cffstream(st); const AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); const char *separator = ic->dump_separator; AVCodecContext *avctx; @@ -524,12 +525,12 @@ static void dump_stream_format(const AVFormatContext *ic, int i, } // Fields which are missing from AVCodecParameters need to be taken from the AVCodecContext - avctx->properties = st->internal->avctx->properties; - avctx->codec = st->internal->avctx->codec; - avctx->qmin = st->internal->avctx->qmin; - avctx->qmax = st->internal->avctx->qmax; - avctx->coded_width = st->internal->avctx->coded_width; - avctx->coded_height = st->internal->avctx->coded_height; + avctx->properties = sti->avctx->properties; + avctx->codec = sti->avctx->codec; + avctx->qmin = sti->avctx->qmin; + avctx->qmax = sti->avctx->qmax; + avctx->coded_width = sti->avctx->coded_width; + avctx->coded_height = sti->avctx->coded_height; if (separator) av_opt_set(avctx, "dump_separator", separator, 0); @@ -544,7 +545,7 @@ static void dump_stream_format(const AVFormatContext *ic, int i, av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id); if (lang) av_log(NULL, AV_LOG_INFO, "(%s)", lang->value); - av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->internal->codec_info_nb_frames, + av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", sti->codec_info_nb_frames, st->time_base.num, st->time_base.den); av_log(NULL, AV_LOG_INFO, ": %s", buf); |