Commit Graph

17 Commits

Author SHA1 Message Date
wm4 d057e7a142 player: fatal error if linked and compiled FFmpeg versions mismatch
We don't support this anymore.

This tries to exit in a controlled way after command line options are
applied in order to honor logging options and, in case of libmpv, not to
kill the host. Not sure if it would be better to just vomit text to
stderr and call abort().
2016-07-01 20:56:59 +02:00
wm4 3ff3749b7d av_log: readd ffmpeg library runtime version mismatch warning
It just happens far too often.
2016-05-01 20:11:15 +02:00
wm4 4e53272376 av_log: avoid partial lines
We want to add a prefix to the ffmpeg log message, so we called mp_msg
multiple times until now. But logging such partial lines is a race
condition, because there's only one internal mp_msg buffer, and no
external mp_msg locks.

Avoid this by building the message on a stack buffer.

I might make a mp_log-local partial line buffer, but even then av_log()
can be called from multiple threads, while targetting the same mp_log.
(Really, ffmpeg's log API needs to be fixed.)
2016-03-01 22:03:45 +01:00
wm4 45345d9c41 build: make libavfilter mandatory
The complex filter support that will be added makes much more complex
use of libavfilter, and I'm not going to bother with adding hacks to
keep libavfilter optional.
2016-02-05 23:17:33 +01:00
wm4 5594333337 av_log: remove dumb shit
It's the user's fault if he/she/it does something that is not
recommended.

Fixes #2110.
2015-07-18 14:21:31 +02:00
wm4 5446637e99 av_log: print FFmpeg version
The individual library versionsd are pretty useless. This will actually
tell us at least the git hash or git tag of the FFmpeg build.
2015-07-03 15:11:29 +02:00
wm4 34fce974c6 av_log: skip prefix if unknown
This happens with av_log(NULL, ...) calls. Drop the "?: " fallback
prefix, because it was confusing.

(Of course FFmpeg should not do this at all, but it's a very long way to
making the FFmpeg log callback sane.)
2015-06-20 17:02:56 +02:00
wm4 f53135ffea av_log: set default av_log callback on exit
This is slightly "dangerous", because it could overwrite a log callback
another library has set, after we've set our own callback. But it's
probably still slightly better than leaving our own callback, which will
run the fallback code if no mpv instance is set. (Multiple mpv instances
sharing the same global state will safely avoid overwriting each other's
log callback.)

Note that we can't do much better, because the global state in FFmpeg is
obviously insane.
2015-06-17 14:52:31 +02:00
Marcin Kurczewski f43017bfe9 Update license headers
Signed-off-by: wm4 <wm4@nowhere>
2015-04-13 12:10:01 +02:00
wm4 e920a00eba player: drop explicit exit() calls
The code in main.c calls exit() explicitly, but the code is actually
easier to follow by simply exiting from main() instead. The exit() call
in av_log.c happens only on severely broken builds, so replace it with
abort().

(Shuts up rpmlint warnings.)
2015-02-12 17:28:22 +01:00
wm4 2868fbea3f av_log: add tons of warnings against mismatched ffmpeg/libav libraries
Print a warning if a library has mismatched compile time and link time
versions.

Refuse to work if the compile time and link time versions are a mix of
ffmpeg and libav. We print an error message and call exit(). Since we'd
randomly crash anyway, I think this is ok.

This doesn't catch the case if you e.g. use a ffmpeg libavcodec and a
libav libavformat, which would of course just crash as quickly, but I
think this checks enough already.
2014-02-10 23:28:10 +01:00
wm4 476a4a378a av_log: restructure version printing code
Makes the following commit simpler.
2014-02-10 23:11:30 +01:00
wm4 eef36f03ea msg: rename mp_msg_log -> mp_msg
Same for companion functions.
2013-12-21 22:13:04 +01:00
wm4 eba5d025d2 msg: convert defines to enum
Also get rid of MSGL_HINT and the many MSGL_DBG* levels.
2013-12-21 22:13:04 +01:00
wm4 d57eaa7e30 av_log: mp_msg conversion
This is pretty nasty, because FFmpeg/Libav is yet another library with a
global message callback. We do something with mutexes trying to get it
done, but of course we can't actually solve this problem. If more than
one library in a process use FFmpeg/Libav, only one of them will get log
messages.
2013-12-21 21:43:16 +01:00
wm4 d8d42b44fc m_option, m_config: mp_msg conversions
Always pass around mp_log contexts in the option parser code. This of
course affects all users of this API as well.

In stream.c, pass a mp_null_log, because we can't do it properly yet.
This will be fixed later.
2013-12-21 21:05:02 +01:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00