History

avcodec/aom_film_grain: Cast const away to suppress compiler warning

av_frame_side_data_add() typically takes ownership of the provided AVBufferRef reference and therefore uses a parameter of type AVBufferRef**; yet with the AV_FRAME_SIDE_DATA_FLAG_NEW_REF, it creates new references instead, without touching the given reference. Therefore it is safe to cast const away.

Andreas Rheinhardt committed 1 year ago

Commit 44ed8f61 parent ae84aa71 file · +2 −1Browse files

Unified · Split

libavcodec/aom_film_grain.c+2−1
@@ -366,7 +366,8 @@ int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *fram · 365 unmodified lines
366366 continue;
367367
368368 if (!av_frame_side_data_add(&frame->side_data, &frame->nb_side_data,
369− AV_FRAME_DATA_FILM_GRAIN_PARAMS, &s->sets[i],
369+ AV_FRAME_DATA_FILM_GRAIN_PARAMS,
370+ (AVBufferRef**)&s->sets[i],
370371 AV_FRAME_SIDE_DATA_FLAG_NEW_REF))
371372 return AVERROR(ENOMEM);
372373 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t