Commit Graph

187 Commits

Author SHA1 Message Date
wm4 7d424b4ce4 command: add better runtime filter toggling method
Basically, see the example in input.rst.

This is better than the "old" vf-toggle method, because it doesn't
require the user to duplicate the filter string in mpv.conf and
input.conf.

Some aspects of this changes are untested, so enjoy your alpha testing.
2017-03-25 17:07:40 +01:00
wm4 0aa01ca743 m_option: optionally allow passing "no" to imgfmt option types
Needed for the following commit.

Also, fix that uint32_t type - we always assumed int.
2017-03-02 11:32:07 +01:00
wm4 4958c1a556 options: some simplifications
Remove more stuff that was needed only for legacy suboptions.

One user-visible change is that parent-options like --tv are now not
visible anymore. They lead to a special error message when used before,
but now they're simply not part of the option list anymore.
2016-11-29 17:10:06 +01:00
wm4 1a2319f3e4 options: remove deprecated sub-option handling for --vo and --ao
Long planned. Leads to some sanity.

There still are some rather gross things. Especially g_groups is ugly,
and a hack that can hopefully be removed. (There is a plan for it, but
whether it's implemented depends on how much energy is left.)
2016-11-25 21:17:25 +01:00
wm4 dc48893630 options: simplify M_OPT_EXIT
There were multiple values under M_OPT_EXIT (M_OPT_EXIT-n for n>=0).
Somehow M_OPT_EXIT-n either meant error code n (with n==0 no error?), or
the number of option valus consumed (0 or 1). The latter is MPlayer
legacy, which left it to the option type parsers to determine whether an
option took a value or not. All of this was changed in mpv, by requiring
the user to use explicit syntax ("--opt=val" instead of "-opt val").

In any case, the n value wasn't even used (anymore), so rip this all
out. Now M_OPT_EXIT-1 doesn't mean anything, and could be used by a new
error code.
2016-09-17 18:07:40 +02:00
wm4 fc1c004cd8 options: fix --list-options after previous commit
Fixes #3509.
2016-09-10 20:49:10 +02:00
wm4 484328fe04 options: make --h list options according to a pattern passed to it
Useless feature, but I want it.

Won't work on Windows due to missing fnmatch().
2016-09-10 16:29:24 +02:00
wm4 849480d0c9 vo_opengl: deprecate sub-options, add them as global options
vo_opengl sub-option were always rather annoying to handle. It seems
better to make them global options instead. This is simpler and easier
to use. The only disadvantage we are aware of is that it's not clear
that many/all of these new global options work with vo_opengl only.

--vo=opengl-hq is also deprecated.

There is extensive compatibility with the old behavior. One exception is
that --vo-defaults will not apply to opengl-hq (though with opengl it
still works). vo-cmdline is also dysfunctional and will be removed in a
following commit.

These changes also affect opengl-cb.

The update mechanism is still rather inefficient: it requires syncing
with the VO after each option change, rather than batching updates.
There's also no granularity (video.c just updates "everything", and if
auto-ICC profiles are enabled, vo_opengl.c will fetch them on each
update).

Most of the manpage changes were done by Niklas Haas <git@haasn.xyz>.
2016-09-02 21:21:47 +02:00
wm4 6b4f560f3c vo, ao: disable positional parameter suboptions
Positional parameters cause problems because they can be ambiguous with
flag options. If a flag option is removed or turned into a non-flag
option, it'll usually be interpreted as value for the first sub-option
(as positional parameter), resulting in very confusing error messages.
This changes it into a simple "option not found" error.

I don't expect that anyone really used positional parameters with --vo
or --ao. Although the docs for --ao=pulse seem to encourage positional
parameters for the host/sink options, which means it could possibly
annoy some PulseAudio users.

--vf and --af are still mostly used with positional parameters, so this
must be a configurable option in the option parser.
2016-09-01 14:21:32 +02:00
wm4 c55d859920 m_option: replace --no-video-aspect alias
Instead, add a hacky OPT_ASPECT option type, which only exists to accept
a "no" parameter, which in combination with the "--no-..." handling code
makes --no-video-aspect work again.

We can also remove the code in m_config.c, which only existed to make
"--no-aspect" (a deprecated alias) to work.
2016-08-31 22:17:21 +02:00
wm4 ce8dae3f0d m_property: remove pointless explicitly clamping
This is basically dead code, and even the commit that added this code 4
years ago said that this should be for debugging only.

(Though it is possible that the clamp callback was used for something
else, and then unused again. Also, some of the clamping code remains and
is used for internal checking, e.g. clamp_double().)
2016-08-31 15:31:51 +02:00
wm4 3bb134969e m_option: remove M_OPT_TYPE_DYNAMIC flag
It's actually redundant with whether m_option_type.free is set. Some
option types were flagged inconsistently. Its only use was for running
an additional sanity check without any real functionality.
2016-08-30 23:45:58 +02:00
wm4 07f8b64754 m_option: add mechanism to allow inf/-inf float options
Used by the next commit.
2016-08-17 21:48:56 +02:00
wm4 3a7e86ff6e m_option: simplify float value range handling
Use clamp_double() to handle all value restriction/verification. The
error messages become a bit less nice, but they were kind of incomplete
before.
2016-08-17 21:44:05 +02:00
wm4 eccabeb81c options: fix channels options copy/free operations
For some fucked up reason the arguments can be NULL. Makes no sense to
me, but ok.
2016-08-05 12:23:15 +02:00
wm4 0b144eac39 audio: use --audio-channels=auto behavior, except on ALSA
This commit adds an --audio-channel=auto-safe mode, and makes it the
default. This mode behaves like "auto" with most AOs, except with
ao_alsa. The intention is to allow multichannel output by default on
sane APIs. ALSA is not sane as in it's so low level that it will e.g.
configure any layout over HDMI, even if the connected A/V receiver does
not support it. The HDMI fuckup is of course not ALSA's fault, but other
audio APIs normally isolate applications from dealing with this and
require the user to globally configure the correct output layout.

This will help with other AOs too. ao_lavc (encoding) is changed to the
new semantics as well, because it used to force stereo (perhaps because
encoding mode is supposed to produce safe files for crap devices?).
Exclusive mode output on Windows might need to be adjusted accordingly,
as it grants the same kind of low level access as ALSA (requires more
research).

In addition to the things mentioned above, the --audio-channels option
is extended to accept a set of channel layouts. This is supposed to be
the correct way to configure mpv ALSA multichannel output. You need to
put a list of channel layouts that your A/V receiver supports.
2016-08-04 20:49:20 +02:00
maniak1349 c4e8c36071 options: --geometry: center window position after applying size
Center window position after applying W and H parameters of the --geometry
option. Passing valid X and Y values will still override the position.

Fixes #2397.
2016-05-22 14:31:37 +02:00
wm4 b2646911a9 client API: access choices as flags if appropriate
Options/properties that are choices, and which include "yes" or "no"
values (or both) can now be read and written as MPV_FORMAT_FLAG.

For write access, rejecting flags in these cases was obnoxiously
unintuitive and inconvenient.

For read access, the value of this is less convincing, and actually it's
a major API change. At this point I probably have to admit that the
finer details of the client API are very unstable.
2016-05-04 17:37:54 +02:00
wm4 a9bd4535d2 client API: improve mpv_set_property() handling of MPV_FORMAT_NODE
If a mpv_node wrapped a string, the behavior was different from calling
mpv_set_property() with MPV_FORMAT_STRING directly. Change this.

The original intention was to be strict about types if MPV_FORMAT_NODE
is used. But I think the result was less than ideal, and the same change
towards less strict behavior was made to mpv_set_option() ages ago.
2016-04-15 11:32:40 +02:00
wm4 0467f5287d m_option: slightly improve --msg-level=help output
In particular get rid of the semi-deprecated ":" separator.
2016-04-13 22:25:51 +02:00
wm4 9a4120f21f m_option: add string conversion for --audio-channels
Requested in #3040.
2016-04-13 22:22:53 +02:00
Dmitrij D. Czarkoff ea442fa047 mpv_talloc.h: rename from talloc.h
This change helps avoiding conflict with talloc.h from libtalloc.
2016-01-11 21:05:55 +01:00
wm4 89f05dc7d1 options: fix conversion of flags to strings
This flags stuff tried to be too clever - if there are overlapping flags
(e.g. exclusive or combined flags), the one matching with most bits has
to be chosen.

This fixes logging of the seek command. E.g. "relative" and "absolute"
overlap to make them exclusive, but "relative" was always printed as it
happened to match first.
2015-07-01 23:05:11 +02:00
wm4 85b7cbec70 options: improve an error message
"mpv --ao=wasapi:help" on Linux gave "Option ao doesn't exist.".
Completely misleading and stupid.
2015-06-27 21:26:05 +02:00
wm4 d6737c5fab audio: replace format name table
Having a big switch() is simpler.
2015-06-26 23:06:21 +02:00
wm4 a3d561f950 options: make keyvalue list parsing less strict
Affects for example --script-opts. A bunch of characters are now allowed
in them without causing trouble to the user.
2015-06-10 23:06:07 +02:00
wm4 8e0cf9d878 options: change [...] to balanced quotes
Useful for dealing with libavfilter's terrible graph syntax.

Not strictly backwards compatible (for example "[a[b]" fails now - the
"[" within the quote is interpreted now). But hopefully it's obscure
enough not to warrant any kind of compatibility hacks.
2015-04-19 15:31:17 +02:00
wm4 9e0cd3b3e7 options: don't let --vf-clr etc. take an argument
It was ignored before. Passing an argument makes no sense, and might be
mistaken for some form of --vf-del, so complain about it.

This also affects --af-clr and the vf/af commands.
2015-04-13 20:30:17 +02:00
Marcin Kurczewski f43017bfe9 Update license headers
Signed-off-by: wm4 <wm4@nowhere>
2015-04-13 12:10:01 +02:00
wm4 5a2825ec35 video: cleanup stereo mode parsing
Use OPT_CHOICE_C() instead of the custom parser. The functionality is
pretty much equivalent.

(On a side note, it seems --video-stereo-mode can't be removed, because
it controls whether to "reduce" stereo video to mono, which is also the
default. In fact I'm not sure how this should be handled at all.)
2015-04-02 23:54:08 +02:00
wm4 9e98702493 options: fix --geometry to string conversion
Fixes #1744.
2015-04-01 22:32:34 +02:00
wm4 27715b7dd1 video: move colorspace overrides to vf_format, simplify
Remove the colorspace-related top-level options, add them to vf_format.
They are rather obscure and not needed often, so it's better to get them
out of the way. In particular, this gets rid of the semi-complicated
logic in command.c (most of which was needed for OSD display and the
direct feedback from the VO). It removes the duplicated color-related
name mappings.

This removes the ability to write the colormatrix and related
properties. Since filters can be changed at runtime, there's no loss of
functionality, except that you can't cycle automatically through the
color constants anymore (but who needs to do this).

This also changes the type of the mp_csp_names and related variables, so
they can directly be used with OPT_CHOICE. This probably ended up a bit
awkward, for the sake of not adding a new option type which would have
used the previous format.
2015-03-31 00:09:03 +02:00
wd0 38b05daf7d parse_commandline: fail gracefully on bad args
Args of zero length (i.e. --=) now display a proper error message.

Signed-off-by: wm4 <wm4@nowhere>
2015-03-29 13:44:34 +02:00
wm4 81a63545a0 options: add conversion to string for geometry option types
Pretty messy, which is why it wasn't done at first. (Also, I'd really
like to have simpler syntax and semantics for this damn option, but who
knows when this will happen.)

Fixes #1705.
2015-03-24 21:50:35 +01:00
wm4 68b71346ec m_option: remove dead initialization 2015-03-23 18:17:38 +01:00
wm4 f447179c59 options: add flag option type 2015-03-04 17:28:42 +01:00
wm4 1eb533afb3 options: handle choice -> flag fallback automatically
In the past it happened quite often that flag options (yes/no) were
changed to choice options (yes/no/some more). The problem with this was
that while flag options don't need a parameter, this wasn't the case
with choice options. A hack was introduced to compensate for this:
setting M_OPT_OPTIONAL_PARAM on the option, and an empty string ("") was
added as choice, so that the choice could be used like a flag. So, for
example, "--mute" would set the choice "".

Fix this by 1. not requiring a parameter if there's a "yes" choice, and
2. redirect an empty parameter to "yes". The effect is that a choice
option with the choices ["yes", "no"] is pretty much equivalent to a
flag option.
2015-02-27 18:31:24 +01:00
wm4 b143102f6d options: minor simplification in flag option parser 2015-02-27 18:17:46 +01:00
wm4 ffe894ec0a options: change --msg-level option
Make it accept "," as separator, instead of only ":". Do this by using
the key-value-list parser. Before this, the option was stored as a
string, with the option parser verifying that the option value as
correct. Now it's stored pre-parsed, although the log levels still
require separate verification and parsing-on-use to some degree (which
is why the msg-level option type doesn't go away).

Because the internal type changes, the client API "native" type also
changes. This could be prevented with some more effort, but I don't
think it's worth it - if MPV_FORMAT_STRING is used, it still works the
same, just with a different separator on read accesses.
2015-02-06 16:48:52 +01:00
wm4 1a38741dce options: allow ":" as separator in key-value lists
Before this, unquoted occurrences of ":" lead to parsing errors. There's
no reason to reject it, especially since the traditional MPlayer syntax
uses ":" as separator. (Which is also the reason why ":" was rejected
before: the parser shares this code for handling splitting/quoting, and
we merely checked explicitly whether the option was split on ",".)
2015-02-06 15:42:12 +01:00
wm4 9248f75853 options: allow things like --geometry=x50
Although the use is somewhat questionable, it seems strange that e.g.
--geometry=50% works (and sets the width only), but setting the height
only in a similar manner does not work.
2015-02-04 23:15:14 +01:00
wm4 cf8fa2bdd4 options: slightly improve help output for choice and flag options 2015-02-02 18:07:37 +01:00
wm4 2768ded1b9 options: fix parsing for --ab-loop-*
Editing mistake. Oops.
2014-12-12 23:22:50 +01:00
wm4 d054289f66 options: add slightly more sophistcated mechanism for option deprecation 2014-12-11 01:04:15 +01:00
wm4 d1aabb6316 m_option: never return NOPTS value as number from properties
MP_NOPTS_VALUE (basically INT64_MIN) is basically an special timestamp
value that means "unset" or "unknown". Its exact value is internal, and
should never be returned or interpreted by any API.

So return "no" instead (what is also what the parser accepts).
2014-12-10 17:15:43 +01:00
wm4 52c51149db options: fix channel map options sometimes failing
Channel amp otpions were not copied correctly: it copied the size of a
pointer to struct chmap, not the struct itself. Since mp_chmap is
currently 9 bytes, this meant the last channel entry was not copied
correctly on 64 bit systems, leading to very strange failures. It could
be triggered especially when using the client API, because the client
API always copies options on access (mpv command line options tend to
work directly on options).
2014-12-01 16:09:25 +01:00
wm4 62998e9709 options: fix swapped deprecated/replacement in warning
This was relevant for --af and --vo (both use this option type, and have
deprecated aliases).
2014-12-01 15:30:24 +01:00
wm4 8c2b78ea5a options: simplify channel map validation
The min=-1 case was never used, and the channel map must always be valid
(or in some cases, invalid but empty).
2014-12-01 15:29:02 +01:00
wm4 e082c2c3df Remove some unneeded NULL checks
Found by Coverity; also see commit 85fb2af3.
2014-11-21 09:58:09 +01:00
wm4 4bd6c91d9b command: implement A-B loops
Probably needs to be polished a bit more. Also, might require a key
binding that can set/clear the loop points in a more intuitive way.

For now, something like this can be put into input.conf to use it:

ctrl+y set ab-loop-a ${time-pos}    # set A
ctrl+x set ab-loop-b ${time-pos}    # set B
ctrl+c set ab-loop-a no             # clear (mostly)

Fixes #1241.
2014-11-18 01:36:35 +01:00
wm4 5d12a2696e command: export some option metadata
This might be interesting for GUIs and such.

It's probably still a little bit insufficient. For example, the filter
and audio/video output lists are not available through this.
2014-11-13 18:01:27 +01:00
wm4 4590ac2082 m_option: format mpv_node as json
Useful for debugging and informational purposes. Not sure if it's sane
in any form.
2014-10-23 15:13:05 +02:00
wm4 ff029cb4cf lua: strictly free memory on errors
Thanks to the recently introduced mp_lua_PITA(), this is "simple" now.
It fixes leaks on Lua errors. The hack to avoid stack overflows
manually isn't needed anymore, and the Lua error handler will take
care of this.
2014-10-19 05:51:37 +02:00
wm4 8599c959fe video: initial Matroska 3D support
This inserts an automatic conversion filter if a Matroska file is marked
as 3D (StereoMode element). The basic idea is similar to video rotation
and colorspace handling: the 3D mode is added as a property to the video
params. Depending on this property, a video filter can be inserted.

As of this commit, extending mp_image_params is actually completely
unnecessary - but the idea is that it will make it easier to integrate
with VOs supporting stereo 3D mogrification. Although vo_opengl does
support some stereo rendering, it didn't support the mode my sample file
used, so I'll leave that part for later.

Not that most mappings from Matroska mode to vf_stereo3d mode are
probably wrong, and some are missing.

Assuming that Matroska modes, and vf_stereo3d in modes, and out modes
are all the same might be an oversimplification - we'll see.

See issue #1045.
2014-08-30 23:24:46 +02:00
wm4 ff7a1c21ce options: more detailed output for --vf-... error message 2014-08-28 17:51:33 +02:00
wm4 9a6d7af074 options: fix key-value-list options
The parser can be called with dst (the target) set to NULL if the option
should be verified only. The code didn't respect this, and could result
in crashes when used in config profiles or filter sub-options.

Fixes #981.
2014-08-05 02:24:45 +02:00
wm4 9a210ca2d5 Audit and replace all ctype.h uses
Something like "char *s = ...; isdigit(s[0]);" triggers undefined
behavior, because char can be signed, and thus s[0] can be a negative
value. The is*() functions require unsigned char _or_ EOF. EOF is a
special value outside of unsigned char range, thus the argument to the
is*() functions can't be a char.

This undefined behavior can actually trigger crashes if the
implementation of these functions e.g. uses lookup tables, which are
then indexed with out-of-range values.

Replace all <ctype.h> uses with our own custom mp_is*() functions added
with misc/ctype.h. As a bonus, these functions are locale-independent.
(Although currently, we _require_ C locale for other reasons.)
2014-07-01 23:11:08 +02:00
Tsukasa OMOTO 1aef780b6c options: support setting start time relative to start PTS
Signed-off-by: wm4 <wm4@nowhere>
2014-06-29 20:39:49 +02:00
wm4 b7bedbbc36 options: remove some more stuff
The "classic" sub-option stuff is not really needed anymore. The only
remaining use can be emulated in a simpler way. But note that this
breaks the --screenshot option (instead of the "flat" options like
--screenshot-...). This was undocumented and discouraged, so it
shouldn't affect anyone.
2014-06-13 02:18:26 +02:00
wm4 6a4a5595d8 options: remove OPT_FLAG_CONSTANTS
This means use of the min/max fields can be dropped for the flag option
type, which makes some things slightly easier. I'm also not sure if the
client API handled the case of flag not being 0 or 1 correctly, and this
change gets rid of this concern.
2014-06-13 02:10:45 +02:00
wm4 924d4db0de options: change --sub-file behavior
--sub-file is actually a string list, so you can add multipel external
subtitle files. But to be able to set a list, the option value was split
on ",". This made it impossible to add filenames.

One possible solution would be adding escaping. That's probably a good
idea (and some other options already do this), but it's also complicated
both to implement and for the user.

The simpler solution is making --sub-file appending, and make it take
only a single entry.

I'm not quite sure about this yet. It breaks the invariant that if a
value is printed and parsed, you get the same value back. So for now,
just go with the simple solution.

Fixes #840.
2014-06-08 00:03:45 +02:00
wm4 2bc871b577 m_option: use isfinite() instead of isnormal()
This accidentally rejected d==0. We can actually deal with sub-normals
fine, we just want to exclude nan and infinity (although infinity is
already accounted for, but anyway).
2014-06-01 17:23:56 +02:00
wm4 05bad1f57a command: allow native access to "vf" property
This allows client API users and Lua scripts to side-step the pretty
horrible video filter string "language" (although it's back and can't be
avoided when using libavfilter).
2014-04-24 02:30:00 +02:00
wm4 059d989bf6 options: don't allow --no-foo=yes
It's a bit strange to allow this, so get rid of it.

This probably breaks a bunch of user config files.

The client API still allows setting them with MPV_FORMAT_FLAG with a
value of 1 (i.e. true), but I guess this is tolerable.
2014-04-14 20:51:27 +02:00
wm4 186fd0311d video: change image format names, prefer mostly FFmpeg names
The most user visible change is that "420p" is now displayed as
"yuv420p". This is what FFmpeg uses (almost), and is also less confusing
since "420p" is often confused with "420 pixels vertical resolution".

In general, we return the FFmpeg pixel format name. We still use our own
old mechanism to keep a list of exceptions to provide compatibility for
a while.

Also, never return NULL for image format names. If the format is unset
(0/IMGFMT_NONE), return "none". If the format has no name (probably
never happens, FFmpeg seems to guarantee that a name is set), return
"unknown".
2014-04-14 20:51:27 +02:00
wm4 378a15564c m_option: fix handling of empty channel layouts
Even if a channel map option signaled that empty layouts are accepted,
the option parser never actually accepted them.
2014-03-10 01:48:18 +01:00
wm4 5eab4f43ec m_option: make converting mpv_node to string always fail 2014-02-26 22:30:18 +01:00
wm4 25f086973f m_option: fix key/value list string conversion
Meh.
2014-02-26 21:03:35 +01:00
wm4 8461143ed7 m_option: don't make "unset" string and string list return NULL strings
This is a bit weird: m_option_string types (i.e. char*) can be NULL. But
they're supposed to be treated just like empty strings. So don't make
the m_option_type.print function return NULL for these values. Returning
NULL would mean failure.

This didn't matter much before, but was quite visible through the client
API.
2014-02-26 21:03:35 +01:00
wm4 e94bab5a99 m_option: add a way to convert values to/from mpv_node
m_option is basically the mechanism to handle C data types in a dynamic
way. Add functions to convert values to and from mpv_node. For example,
string lists are turned into mpv_node using MPV_FORMAT_NODE_ARRAY, and
so on.
2014-02-24 22:50:23 +01:00
wm4 e3f7d4f5ea m_option: fix printf format specifier 2014-02-24 12:00:56 +01:00
wm4 c3c82f5c3b m_option: explicitly allow m_option.name==NULL
Doesn't require other code to care about this, which will allow us to
simplify the property code.

Only "wildcard" options like "vf" and string lists used this, and
m_option_list_findb() (which is excused).
2014-02-23 16:49:18 +01:00
wm4 98dc8206ae options: handle escape sequences in e.g. --playing-msg differently
M_OPT_PARSE_ESCAPES was pretty stupid, and broke the (useful) assumption
that string variables contain exactly the same value as set by the
option. Simplify it, and move escape handling to the place where it's
used.

Escape handling itself is not terribly useful, but still allows useful
things like multiline custom OSD with "\n".
2014-02-20 14:46:23 +01:00
wm4 36f6e6b826 options: alternative way to specify color options
Try to make it more intuitive by not requiring hex values. The new way
uses float values in the range 0.0-1.0, separated by '/' (':' was
suggested, but that wouldn't allow color options in sub-options).

Example: --osd-color=1.0/0.0/0.0/0.75

Using the range 0.0-1.0 has the advantage that it could be easily
extended to colors beyond 8 bit.

Details see manpage.

Suggestions for alternative syntax or value ranges are welcome, but be
quick with it.
2014-01-31 00:41:54 +01:00
wm4 82067e6ac3 options: add key/value pair list option type 2014-01-16 23:06:41 +01:00
wm4 99ee43b33b msg: move special declarations to msg_control.h
While almost everything uses msg.h, the moved definitions are rarely
needed by anything.
2014-01-16 23:06:40 +01:00
wm4 2214ee8472 options: make --msglevel=help print something helpful 2014-01-01 19:42:48 +01:00
wm4 066ecfcbfb common: simplify and optimize string escape parsing
This code is shared between input.conf parser and option parser. Until
now, the performance didn't really matter. But I want to use this code
for JSON parsing too, and since JSON will have to be parsed a lot, it
should probably try to avoid realloc'ing too much.

This commit moves parsing of C-style escaped strings into a common
function, and allows using it in a way realloc can be completely
avoided, if the already allocated buffer is large enough.
2013-12-30 22:49:50 +01:00
wm4 dacb6ad98f options: simplify handling of some help options 2013-12-26 19:25:51 +01:00
wm4 bd5e0a2ba2 options: make --msglevel extend previous settings
Make it so --msglevel extends previous --msglevel uses, instead of
overwriting them. Do this by literally appending the --msglevel option
value to the previous one.
2013-12-22 12:18:01 +01:00
wm4 7bdee8f35e m_option: add mp_log context to sub-module print_help callback 2013-12-21 21:43:16 +01:00
wm4 9242c34fa2 m_option: add mp_log callback to OPT_STRING_VALIDATE options
And also convert a bunch of other code, especially ao_wasapi and
ao_portaudio.
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 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 80b34ebea4 m_option: don't include config.h in header
Requires a small workaround.
2013-12-18 17:12:27 +01:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
wm4 eb15151705 Move options/config related files from mpvcore/ to options/
Since m_option.h and options.h are extremely often included, a lot of
files have to be changed.

Moving path.c/h to options/ is a bit questionable, but since this is
mainly about access to config files (which are also handled in
options/), it's probably ok.
2013-12-17 02:07:57 +01:00