diff options
author | James Almer <jamrial@gmail.com> | 2023-07-16 17:57:26 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-10-06 10:03:57 -0300 |
commit | 5432d2aacad5fa7420fe2d9369ed061d521e92d6 (patch) | |
tree | 9c1bf0307108a16ed652261d590042e5944e288d /libavformat/replaygain.c | |
parent | 21d7cc6fa9a26e94965fa71b25655d07568450fe (diff) | |
download | ffmpeg-5432d2aacad5fa7420fe2d9369ed061d521e92d6.tar.gz |
avformat/avformat: use the side data from AVStream.codecpar
Deprecate AVStream.side_data and its helpers in favor of the AVStream's
codecpar.coded_side_data.
This will considerably simplify the propagation of global side data to decoders
and from encoders. Instead of having to do it inside packets, it will be
available during init().
Global and frame specific side data will therefore be distinct.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/replaygain.c')
-rw-r--r-- | libavformat/replaygain.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/replaygain.c b/libavformat/replaygain.c index 915bcb2382..910274c827 100644 --- a/libavformat/replaygain.c +++ b/libavformat/replaygain.c @@ -69,16 +69,20 @@ static int32_t parse_value(const char *value, int32_t min) int ff_replaygain_export_raw(AVStream *st, int32_t tg, uint32_t tp, int32_t ag, uint32_t ap) { + AVPacketSideData *sd; AVReplayGain *replaygain; if (tg == INT32_MIN && ag == INT32_MIN) return 0; - replaygain = (AVReplayGain*)av_stream_new_side_data(st, AV_PKT_DATA_REPLAYGAIN, - sizeof(*replaygain)); - if (!replaygain) + sd = av_packet_side_data_new(&st->codecpar->coded_side_data, + &st->codecpar->nb_coded_side_data, + AV_PKT_DATA_REPLAYGAIN, + sizeof(*replaygain), 0); + if (!sd) return AVERROR(ENOMEM); + replaygain = (AVReplayGain*)sd->data; replaygain->track_gain = tg; replaygain->track_peak = tp; replaygain->album_gain = ag; |