forked from FFmpeg/FFmpeg
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:
parent
42e72d5c8b
commit
f635f19537
1 changed files with 3 additions and 7 deletions
|
@ -362,18 +362,14 @@ int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *fram
|
|||
return 0;
|
||||
|
||||
for (int i = 0; i < FF_ARRAY_ELEMS(s->sets); i++) {
|
||||
AVBufferRef *buf;
|
||||
|
||||
if (!s->sets[i])
|
||||
continue;
|
||||
|
||||
buf = av_buffer_ref(s->sets[i]);
|
||||
if (!buf || !av_frame_new_side_data_from_buf(frame,
|
||||
AV_FRAME_DATA_FILM_GRAIN_PARAMS, buf)) {
|
||||
av_buffer_unref(&buf);
|
||||
if (!av_frame_side_data_add(&frame->side_data, &frame->nb_side_data,
|
||||
AV_FRAME_DATA_FILM_GRAIN_PARAMS, &s->sets[i],
|
||||
AV_FRAME_SIDE_DATA_FLAG_NEW_REF))
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue