You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/aom_film_grain: use av_frame_side_data_add() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -362,17 +362,13 @@ int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *fram
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (int i = 0; i < FF_ARRAY_ELEMS(s->sets); i++) {
|
for (int i = 0; i < FF_ARRAY_ELEMS(s->sets); i++) {
|
||||||
AVBufferRef *buf;
|
|
||||||
|
|
||||||
if (!s->sets[i])
|
if (!s->sets[i])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
buf = av_buffer_ref(s->sets[i]);
|
if (!av_frame_side_data_add(&frame->side_data, &frame->nb_side_data,
|
||||||
if (!buf || !av_frame_new_side_data_from_buf(frame,
|
AV_FRAME_DATA_FILM_GRAIN_PARAMS, &s->sets[i],
|
||||||
AV_FRAME_DATA_FILM_GRAIN_PARAMS, buf)) {
|
AV_FRAME_SIDE_DATA_FLAG_NEW_REF))
|
||||||
av_buffer_unref(&buf);
|
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user