Commit Graph

319 Commits

Author SHA1 Message Date
wm4 9149e2af56 playlist_parser: mp_msg conversion 2013-12-21 21:43:16 +01:00
wm4 9428e05b3f encode_lavc: mp_msg conversions
Miss two mp_msg calls, because these conflict with future commits.
2013-12-21 21:43:16 +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 02a9fbd0ce codecs: avoid having to print error message
The mp_select_decoders() function doesn't have a log context (and I
don't want to give it one), so get rid of the mp_msg error message by
enhancing the semantics such that the syntax error is replaced by a new
feature. Now doing "--ad=something" will enable all decoders in the
"something" module, same as "--ad=something:*". Pretty useless, but gets
rid of the annoyance.
2013-12-21 20:50:13 +01:00
wm4 5f0fbacf16 codecs: mp_msg conversion 2013-12-21 20:50:12 +01:00
wm4 71b6a52295 av_common: abuse av_log to print message instead of mp_msg
Saves a little bit of pain.
2013-12-21 20:50:12 +01:00
wm4 ad05e76c57 msg: handle vsnprintf errors
I don't know under which circumstances this can error (other than a
broken format string). It seems it won't return an error code on I/O
errors, so maybe broken format strings are the only case. Either way,
don't continue if an error is returned.
2013-12-20 21:07:58 +01:00
wm4 e9e68fc399 msg: use a global lock to synchronize printing
We have certain race conditions coming from doing multiple fprintf()
calls (setting up colors etc.). I'm not sure whether it would be worth
changing to code such that we do only one fprintf() call (and assume
this synchronizes access), but considering it would be hard to do
(Windows compatibility, ...), and that stdio uses per FILE locks anyway,
this is simpler and probably not less efficient. Also, there's no
problem handling the weird statusline special case this way.

Note that mp_msg_* calls which are silent won't acquire the lock, and
acquiring the lock happens on actual output only (which is slow and
serialized anyway).
2013-12-20 21:07:58 +01:00
wm4 6a8fc3f5e3 msg: change --msglevel, reduce legacy glue
Basically, reimplement --msglevel. Instead of making the new msg code
use the legacy code, make the legacy code use the reimplemented
functionality.

The handling of the deprecated --identify switch changes. It temporarily
stops working; this will be fixed in later commits.

The actual sub-options syntax (like --msglevel-vo=...) goes away, but I
bet nobody knew about this or used this anyway.
2013-12-20 21:07:57 +01:00
wm4 5162c2709e msg: cosmetic changes
In particular, condense the legacy MSGT_ defines and move them to the
end of the file.
2013-12-20 21:07:57 +01:00
wm4 591a6722d2 msg: change hack to silence command line pre-parse error messages
mp_msg_levels[] will go away.
2013-12-20 21:07:57 +01:00
wm4 78292058cc terminal: remove separate formatting for --msgmodule
Instead, --msgmodule uses the same formatting as -v.
2013-12-20 21:07:57 +01:00
wm4 4d4b822171 terminal: abstract terminal color handling
Instead of making msg.c an ifdef hell for unix vs. windows code, move
the code to separate functions defined in terminal-unix.c/terminal-
win.c.

Drop the code that selects random colors for --msgmodule prefixes.
2013-12-20 21:07:57 +01:00
wm4 833eba5304 terminal: move SIGTTOU signal handler setup code
This comes with a real change in behavior: now the signal handler is set
only when the terminal input code is active (e.g. not with
--no-consolecontrols), but this should be ok.
2013-12-19 21:31:33 +01:00
wm4 25d4ae74f1 Rename getch2....c/h to terminal....c/h
"getch2" really tells nothing about what the heck this code does. It'd
be even worse when moving the rest of terminal handling code there.
2013-12-19 21:31:27 +01:00
wm4 2c08bf1bd7 Reduce recursive config.h inclusions in headers
In my opinion, config.h inclusions should be kept to a minimum. MPlayer
code really liked including config.h everywhere, though, even in often
used header files. Try to reduce this.
2013-12-18 17:12:21 +01:00
wm4 4ed83fe2e5 Remove the _ macro
This was a gettext-style macro to mark strings that should be
translated.
2013-12-18 17:12:07 +01:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00