History

avfilter/formats: Constify channel_layout in ff_add_channel_layout()

It copies, not moves the channel layout.

Andreas Rheinhardt committed 4 years ago

Commit 41a558f1 parent 2c8f9782 files · +4 −2Browse files

Unified · Split

2 files
  1. libavfilter/formats.c +2 −1
  2. libavfilter/formats.h +2 −1
libavfilter/formats.c+2−1
@@ -464,7 +464,8 @@ do { \ · 463 unmodified lines
464 (*f)->nb++; \464 (*f)->nb++; \
465} while (0)465} while (0)
466 466
467int ff_add_channel_layout(AVFilterChannelLayouts **l, AVChannelLayout *channel_layout)467int ff_add_channel_layout(AVFilterChannelLayouts **l,
468 const AVChannelLayout *channel_layout)
468{469{
469 av_assert1(!(*l && (*l)->all_layouts));470 av_assert1(!(*l && (*l)->all_layouts));
470 ADD_FORMAT(l, channel_layout, ff_channel_layouts_unref, AVChannelLayout, channel_layouts, nb_channel_layouts);471 ADD_FORMAT(l, channel_layout, ff_channel_layouts_unref, AVChannelLayout, channel_layouts, nb_channel_layouts);
libavfilter/formats.h+2−1
@@ -180,7 +180,8 @@ av_warn_unused_result · 179 unmodified lines
180int ff_set_common_formats_from_list(AVFilterContext *ctx, const int *fmts);180int ff_set_common_formats_from_list(AVFilterContext *ctx, const int *fmts);
181 181
182av_warn_unused_result182av_warn_unused_result
183int ff_add_channel_layout(AVFilterChannelLayouts **l, AVChannelLayout *channel_layout);183int ff_add_channel_layout(AVFilterChannelLayouts **l,
184 const AVChannelLayout *channel_layout);
184 185
185/**186/**
186 * Add *ref as a new reference to f.187 * Add *ref as a new reference to f.

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