- show usage with "help"
- print error if setvbuf fails (but do not return an error - there may
be some platform problem but the setting is done always, so it would
unconditionally prevent UltraGrid from running)
- if usage error (or help) occurs, exit UltraGrid
setvbuf() should be called on a stream prior to any operation with the
stream. Previously it was to late -- it was even after configuration
summary was printed to stdout.
The value 0 is mentioned in man setvbuf(3) and indeed glibc
implements setlinebuf as:
_IO_setvbuf (stream, NULL, 1, 0);
However, except the mention in manual page, this extension doesn't seem
to be anywhere mentioned (not clear if valid with _IOFBF) and it is not
widespread except glibc, since [1] forbids that. Also using _IOLBF+0
behaves in the same way as _IOLBF+BUFSIZ (buffers BUFSIZ bytes).
[1] https://www.ibm.com/docs/en/i/7.1?topic=functions-setvbuf-control-buffering
Set output buffering to "line" for stdout and "no" for stderr. This is
the case usually but not always (eg. MSYS, GUI console) so make this
explicit to be deterministic.
Some macros are quite common so it is perhaps more wise to use a
separate header.
Also moved ref_count_init_once and ref_count_terminate last to misc.h.
Unless MALLOC_TRACE environment variable is set, no hook is installed
and the calls have no effect. On the other hand, if we compile it
unconditionally, it can be used without need to recompile UltraGrid.
mtrace(), however, doesn't seem to be much helpful (compared to eg.
valgrind).
This looks to be more reasonable - user may not know that s/he actually
wants to set it. The thing is that this may be needed only for stdout -
user than doesn't detect that some output is missing.
Skip repeating registration of the same parameter.
This allows registration of the param from within more modules (eg.
common file included in multiple plugins). Warning is issued if already
registered param has a different description.
- allow also comma as a delimiter (WLOG - comma cannot be part of
current set of options)
- print token, that is not understood
- hint that "bps" must be in bits-per-second (% 8 = 0)
The .id field previously contained the module name for audio devices,
while it only contained options for video devices. To make things more
consistent there are now two fields: "module" which contains the module
name and "device" which contains only the parameters.
Capturers may decide by themselves or capture DEFAULT_AUDIO_CAPTURE_CHANNELS
(as until now). This fixes default behavior of WASAPI with Realtek sound cards
that is unable to capture single channel.
Currently GIT_BRANCH refers to rather tag than release name, it would be needed
rather "git rev-parse --abbrev-ref HEAD" instead of "git name-rev --name-only
HEAD". But with shellow clones (as in GitHub) it would also require the
repository to be unshallowed.