[FFmpeg-cvslog] avcodec/utils: Fix ff_add_cpb_side_data() add twice

Nicolas Gaullier git at videolan.org
Fri Mar 20 11:41:56 EET 2020


ffmpeg | branch: master | Nicolas Gaullier <nicolas.gaullier at cji.paris> | Thu Mar  5 09:17:23 2020 +0100| [42271f8e182a85ac1d6706e0461b37895fd6c1f0] | committer: Anton Khirnov

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 at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42271f8e182a85ac1d6706e0461b37895fd6c1f0
---

 libavcodec/utils.c | 5 +++++
 1 file changed, 5 insertions(+)

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)



More information about the ffmpeg-cvslog mailing list