Not critical at all - the comma-separated option could not have been
used so far (it was intended to separate modules, but this funcion is
used in only one so far).
use static, not thread_local storage
This has an implications that the message is indeed printed once, even
though is called from 2 threads (this can happen eg. when printed once
during normal operation and then during module deletion, that may happen
in a different thread).
The returned value was actually incorrect (counting also formatting
escape sequences and terminating nul byte).
Since the return value should not be important for the caller, it is
perhaps better not to complicate and don't return anything.
fixes warnings with Xcode 14.3 as in previous commit
+ allocate +1 in Log_output buffer - snprintf(MULL, 0...) returns number
of bytes without terminating '\0'. std::string storage isn't guaranteed
to be NULL-terminated (std::string("").at(0) throws an exception). The
buffer is somewhere preallocated 256 which prevents problem but it's
better not to rely upon it.
+ comment out some unused function in LDGM that also triggered the
warning but looked a bit suspicious so it was not clear how to fix
Needs adding log_msg_once variable arguments (printf-like).
+ print always error in deinterlace - if user explicitly wants
deinterlace PP, maybe we should notify loudly
On one-shot second and further calls of one-shot message, no output was
producet, yet empty buffer was submitted to Log_output resulting in
false repeate messages:
Last message repeated <n> times
To simplify the stuff, C++ API was removed and in the C API the Logger
is taken only if actual message will be output. If someone is willing to
use the C++ API, it can be later readded (not really needed now, only
simple message are presented).
Previously colored output using the inline TERM_* macros from color_out.h was
done only using the color_printf() function. Since there are now places
where they are used with log_msg(), we need to prune ansi codes here
too.
Removed indirect dependency on rang.hpp through color_out.h. Now only
remaining dependencies on rang.hpp are direct.
+ fixed escape sequence for foreground magenta
+ change first parameter of serialize callback to (const void *)
+ renamed "lavd-uncompressed" to "lavd-avframe" - uncompressed is vague
since there are multiple forms of uncompressed - avframe, ultragrid
pixfmt...
GCC 11 gives incorrect warning for unintialized strerror_buf on
strerror_buf.size(), which is, however, compile-time constant. As a
workaround a separate size constant is used.
Force color output if both stdout and stderr are connected to terminal.
The setting is global and it is possible that only stdout is redirected
(eg. to pager) while the check here was for clog (cerr) only. Thus
escape sequences had been unintentionally output to the pipe.