Commit 42271f8e authored by Nicolas Gaullier's avatar Nicolas Gaullier Committed by 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: 's avatarAnton Khirnov <anton@khirnov.net>
parent 2d6baff0
...@@ -1981,6 +1981,11 @@ AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx) ...@@ -1981,6 +1981,11 @@ AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx)
AVPacketSideData *tmp; AVPacketSideData *tmp;
AVCPBProperties *props; AVCPBProperties *props;
size_t size; 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); props = av_cpb_properties_alloc(&size);
if (!props) if (!props)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment