summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavutil/channel_layout.c
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-04-26 16:49:15 -0500
committertrav90 <travawine@protonmail.ch>2018-04-26 16:49:15 -0500
commit8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298 (patch)
treec37da5241afd7cda6f92d394e14cef7d5dcbb4e5 /media/ffvpx/libavutil/channel_layout.c
parent56a2df6b25bc93ea9a59b8e0bf8029f752f68573 (diff)
downloadUXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.tar
UXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.tar.gz
UXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.tar.lz
UXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.tar.xz
UXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.zip
[ffvpx] Update ffvp9/ffvp8 to 3.4.2-release
Structure of code was slightly modified so that it should be no longer necessary to re-generate the config_*.h files, greatly simplifying the resync process in the future.
Diffstat (limited to 'media/ffvpx/libavutil/channel_layout.c')
-rw-r--r--media/ffvpx/libavutil/channel_layout.c22
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)
{