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/wavdec.c | |
parent | 9f05b3ba604a30eeb6f5ff877b8b5b5c93a268d7 (diff) | |
download | ffmpeg-40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113.tar.gz |
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/wavdec.c')
-rw-r--r-- | libavformat/wavdec.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 815d189671..7a7e765353 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -166,8 +166,9 @@ static int wav_probe(const AVProbeData *p) static void handle_stream_probing(AVStream *st) { if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE) { - st->internal->request_probe = AVPROBE_SCORE_EXTENSION; - st->internal->probe_packets = FFMIN(st->internal->probe_packets, 32); + FFStream *const sti = ffstream(st); + sti->request_probe = AVPROBE_SCORE_EXTENSION; + sti->probe_packets = FFMIN(sti->probe_packets, 32); } } @@ -183,7 +184,7 @@ static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream *st) return ret; handle_stream_probing(st); - st->internal->need_parsing = AVSTREAM_PARSE_FULL_RAW; + ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW; avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); @@ -200,7 +201,7 @@ static int wav_parse_xma2_tag(AVFormatContext *s, int64_t size, AVStream *st) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_XMA2; - st->internal->need_parsing = AVSTREAM_PARSE_FULL_RAW; + ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW; version = avio_r8(pb); if (version != 3 && version != 4) @@ -702,8 +703,8 @@ static int wav_read_packet(AVFormatContext *s, AVPacket *pkt) int64_t audio_dts, video_dts; AVStream *vst = wav->vst; smv_retry: - audio_dts = (int32_t)st->internal->cur_dts; - video_dts = (int32_t)vst->internal->cur_dts; + audio_dts = (int32_t)ffstream( st)->cur_dts; + video_dts = (int32_t)ffstream(vst)->cur_dts; if (audio_dts != AV_NOPTS_VALUE && video_dts != AV_NOPTS_VALUE) { /*We always return a video frame first to get the pixel format first*/ @@ -950,7 +951,7 @@ static int w64_read_header(AVFormatContext *s) ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv); handle_stream_probing(st); - st->internal->need_parsing = AVSTREAM_PARSE_FULL_RAW; + ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW; avio_seek(pb, data_ofs, SEEK_SET); |