We can use the presence of the version header to detect libspatialaudio
0.4.0 or higher. (For more granular checks in the future, the defines
from the version header can be checked)
When cross-compiling from Linux with xcode-cross, the clang wrapper
reports a darwin build triplet even though the build machine is Linux.
This causes libtool's max_cmd_len detection to run sysctl kern.argmax,
which doesn't exist on Linux, leading to:
libtool: line 11569: test: : integer expression expected
Only set VLC_BUILD_TRIPLET on Darwin and conditionally pass --build to
configure, letting config.guess auto-detect the build system on Linux.
The json_array_foreach_ref macro declares an anonymous struct type
inside a for-loop initializer:
for (struct { size_t i; const struct json_array *a; } idx = ...
C11 6.8.5p3 constrains the for-loop initializer to only declare
objects with auto or register storage class — in other words, it is
only meant to create loop variables, not to define new types. However,
writing `struct { ... } x = ...;` does two things at once: it defines
a new type (the anonymous struct) and declares a variable.
In C11 standard 6.2.1, struct tags declared inside a for-loop
initializer get block scope of the enclosing block, so the type
definition escapes the for-loop, violating the "only objects"
constraint.
Extract the anonymous struct into a named struct json_array_iter
defined before the macro, so the for-loop initializer only declares a
plain object of an already-existing type.
Clang on armv7 iOS (via xcode-cross) enforces this constraint strictly
and rejects the original code with "declaration of non-local variable in
'for' loop".
This is an incredibly advanced per-media option that is probably more
confusing for users than it does any good. The values are not even
exposed properly, just some of them written in the help text.
If someone really needs this, it can already be set by
--avcodec-options "{bug=...}", so having a dedicated VLC option
that doesn't add any convenience to it is redundant.