diff options
author | Nicolas Gaullier <nicolas.gaullier@cji.paris> | 2020-03-05 09:17:23 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-03-20 09:16:05 +0100 |
commit | 42271f8e182a85ac1d6706e0461b37895fd6c1f0 (patch) | |
tree | 6b7d683d525a62f99a16ccd7aeb09b00095ada5b /libavcodec | |
parent | 2d6baff0c0dbd24d77321601f453bf1552fccfb9 (diff) | |
download | ffmpeg-42271f8e182a85ac1d6706e0461b37895fd6c1f0.tar.gz |
avcodec/utils: Fix ff_add_cpb_side_data() add twice
Makes it behave similarly to av_stream_add_side_data().
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 66bfdaf4f8..4ab8cff4f5 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1981,6 +1981,11 @@ AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx) AVPacketSideData *tmp; AVCPBProperties *props; size_t size; + int i; + + for (i = 0; i < avctx->nb_coded_side_data; i++) + if (avctx->coded_side_data[i].type == AV_PKT_DATA_CPB_PROPERTIES) + return (AVCPBProperties *)avctx->coded_side_data[i].data; props = av_cpb_properties_alloc(&size); if (!props) |