mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2025-01-22 11:59:34 +00:00
lavu: Drop FF_API_GET_CHANNEL_LAYOUT_COMPAT cruft
FATE refs changed to accomodate for the new default behavior of the function. Numbers are now interpreted as a channel layout, instead of a number of channels.
This commit is contained in:
parent
251fb7dcd4
commit
d83dd630a0
@ -106,11 +106,7 @@ static const struct {
|
||||
{ "downmix", 2, AV_CH_LAYOUT_STEREO_DOWNMIX, },
|
||||
};
|
||||
|
||||
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
|
||||
static uint64_t get_channel_layout_single(const char *name, int name_len, int compat)
|
||||
#else
|
||||
static uint64_t get_channel_layout_single(const char *name, int name_len)
|
||||
#endif
|
||||
{
|
||||
int i;
|
||||
char *end;
|
||||
@ -128,27 +124,8 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
|
||||
return (int64_t)1 << i;
|
||||
i = strtol(name, &end, 10);
|
||||
|
||||
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
|
||||
if (compat) {
|
||||
if (end - name == name_len ||
|
||||
(end + 1 - name == name_len && *end == 'c')) {
|
||||
layout = av_get_default_channel_layout(i);
|
||||
if (end - name == name_len) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"Single channel layout '%.*s' is interpreted as a number of channels, "
|
||||
"switch to the syntax '%.*sc' otherwise it will be interpreted as a "
|
||||
"channel layout number in a later version\n",
|
||||
name_len, name, name_len, name);
|
||||
}
|
||||
return layout;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
if ((end + 1 - name == name_len && *end == 'c'))
|
||||
return av_get_default_channel_layout(i);
|
||||
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
|
||||
}
|
||||
#endif
|
||||
|
||||
layout = strtoll(name, &end, 0);
|
||||
if (end - name == name_len)
|
||||
@ -156,11 +133,7 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
|
||||
uint64_t ff_get_channel_layout(const char *name, int compat)
|
||||
#else
|
||||
uint64_t av_get_channel_layout(const char *name)
|
||||
#endif
|
||||
{
|
||||
const char *n, *e;
|
||||
const char *name_end = name + strlen(name);
|
||||
@ -168,11 +141,7 @@ uint64_t av_get_channel_layout(const char *name)
|
||||
|
||||
for (n = name; n < name_end; n = e + 1) {
|
||||
for (e = n; e < name_end && *e != '+' && *e != '|'; e++);
|
||||
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
|
||||
layout_single = get_channel_layout_single(n, e - n, compat);
|
||||
#else
|
||||
layout_single = get_channel_layout_single(n, e - n);
|
||||
#endif
|
||||
if (!layout_single)
|
||||
return 0;
|
||||
layout |= layout_single;
|
||||
@ -180,13 +149,6 @@ uint64_t av_get_channel_layout(const char *name)
|
||||
return layout;
|
||||
}
|
||||
|
||||
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
|
||||
uint64_t av_get_channel_layout(const char *name)
|
||||
{
|
||||
return ff_get_channel_layout(name, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
void av_bprint_channel_layout(struct AVBPrint *bp,
|
||||
int nb_channels, uint64_t channel_layout)
|
||||
{
|
||||
|
@ -276,10 +276,6 @@ static av_always_inline av_const int avpriv_mirror(int x, int w)
|
||||
return x;
|
||||
}
|
||||
|
||||
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
|
||||
uint64_t ff_get_channel_layout(const char *name, int compat);
|
||||
#endif
|
||||
|
||||
void ff_check_pixfmt_descriptors(void);
|
||||
|
||||
extern const uint8_t ff_reverse[256];
|
||||
|
@ -395,11 +395,7 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
|
||||
if (!val || !strcmp(val, "none")) {
|
||||
*(int64_t *)dst = 0;
|
||||
} else {
|
||||
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
|
||||
int64_t cl = ff_get_channel_layout(val, 0);
|
||||
#else
|
||||
int64_t cl = av_get_channel_layout(val);
|
||||
#endif
|
||||
if (!cl) {
|
||||
av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\" as channel layout\n", val);
|
||||
ret = AVERROR(EINVAL);
|
||||
|
@ -87,9 +87,6 @@
|
||||
#ifndef FF_API_VDPAU
|
||||
#define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#endif
|
||||
#ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT
|
||||
#define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
#ifndef FF_API_XVMC
|
||||
#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#endif
|
||||
|
@ -67,11 +67,11 @@ quad(side)
|
||||
8 channels (FL+FR+LFE+BC+SL+SR+DL+DR)
|
||||
8 channels (FL+FR+FC+BC+SL+SR+DL+DR)
|
||||
-1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, blah);
|
||||
0 = ff_parse_channel_layout(0000000000000004, 1, 1);
|
||||
0 = ff_parse_channel_layout(0000000000000003, 2, 2);
|
||||
0 = ff_parse_channel_layout(0000000000000001, 1, 1);
|
||||
0 = ff_parse_channel_layout(0000000000000002, 1, 2);
|
||||
-1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, -1);
|
||||
0 = ff_parse_channel_layout(0000000000000000, 60, 60);
|
||||
-1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, 65);
|
||||
0 = ff_parse_channel_layout(000000000000003C, 4, 60);
|
||||
0 = ff_parse_channel_layout(0000000000000041, 2, 65);
|
||||
0 = ff_parse_channel_layout(0000000000000004, 1, 1c);
|
||||
0 = ff_parse_channel_layout(0000000000000003, 2, 2c);
|
||||
-1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, -1c);
|
||||
@ -79,7 +79,7 @@ quad(side)
|
||||
-1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, 65c);
|
||||
0 = ff_parse_channel_layout(000000000000003F, 6, 5.1);
|
||||
0 = ff_parse_channel_layout(0000000000000003, 2, stereo);
|
||||
0 = ff_parse_channel_layout(0000000000000004, 1, 1+1+1+1);
|
||||
0 = ff_parse_channel_layout(0000000000000001, 1, 1+1+1+1);
|
||||
0 = ff_parse_channel_layout(0000000000000004, 1, 1c+1c+1c+1c);
|
||||
0 = ff_parse_channel_layout(0000000000000007, 3, 2c+1c);
|
||||
0 = ff_parse_channel_layout(0000000000000003, 2, 0x3);
|
||||
|
Loading…
x
Reference in New Issue
Block a user