diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-04-27 19:15:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 19:15:26 +0200 |
commit | c75dae3ed21bfa5a8ae46cd83d18329af5bea05a (patch) | |
tree | ef657c38feb2368a3c86765778d1f068aa5eb614 /media/ffvpx/libavutil/channel_layout.c | |
parent | c82c6d960a7f19d6595171f9705c43514f20c1ec (diff) | |
parent | 6ada4b14e4cfc91f5f1b2556623cab691f3ab813 (diff) | |
download | UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.tar UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.tar.gz UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.tar.lz UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.tar.xz UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.zip |
Merge pull request #275 from trav90/ffvpx-resync
Resync ffvpx code with 3.4.2-release from upstream
Diffstat (limited to 'media/ffvpx/libavutil/channel_layout.c')
-rw-r--r-- | media/ffvpx/libavutil/channel_layout.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/media/ffvpx/libavutil/channel_layout.c b/media/ffvpx/libavutil/channel_layout.c index 26c87c96a..3bd5ee29b 100644 --- a/media/ffvpx/libavutil/channel_layout.c +++ b/media/ffvpx/libavutil/channel_layout.c @@ -152,6 +152,28 @@ uint64_t av_get_channel_layout(const char *name) return layout; } +int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, int* nb_channels) +{ + int nb = 0; + char *end; + uint64_t layout = av_get_channel_layout(name); + + if (layout) { + *channel_layout = layout; + *nb_channels = av_get_channel_layout_nb_channels(layout); + return 0; + } + + nb = strtol(name, &end, 10); + if (!errno && *end == 'C' && *(end + 1) == '\0' && nb > 0 && nb < 64) { + *channel_layout = 0; + *nb_channels = nb; + return 0; + } + + return AVERROR(EINVAL); +} + void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout) { |