Commit Graph

1066 Commits

Author SHA1 Message Date
wm4 831a7cf3ee input: trigger mouse_leave key bindings if mouse leaves mouse area
Also, implement mouse leave events for X11. But evne on other
platforms, these events will be generated if mouse crosses a section's
mouse area boundaries within the mpv window.
2013-06-29 22:58:13 +02:00
wm4 5b38a522f1 input: handle mouse movement differently
Before this commit, mouse movement events emitted a special command
("set_mouse_pos"), which was specially handled in command.c. This was
once special-cased to the dvdnav and menu code, and did nothing after
libmenu and dvdnav were removed.

Change it so that mouse movement triggers a pseudo-key ("MOUSE_MOVE"),
which then can be bound to an arbitrary command. The mouse position is
now managed in input.c. A command which actually needs the mouse
position can use either mp_input_get_mouse_pos() or mp_get_osd_mouse_pos()
to query it. The former returns raw window-space coordinates, while the
latter returns coordinates transformed to OSD- space. (Both are the same
for most VOs, except vo_xv and vo_x11, which can't render OSD in
window-space. These require extra code for mapping mouse position.)

As of this commit, there is still nothing that uses mouse movement, so
MOUSE_MOVE is mapped to "ignore" to silence warnings when moving the
mouse (much like MOUSE_BTN0).

Extend the concept of input sections. Allow multiple sections to be
active at once, and organize them as stack. Bindings from the top of
the stack are preferred to lower ones.

Each section has a mouse input section associated, inside which mouse
events are associated with the bindings. If the mouse pointer is
outside of a section's mouse area, mouse events will be dispatched to
an input section lower on the stack of active sections. This is intended
for scripting, which is to be added later. Two scripts could occupy
different areas of the screen without conflicting with each other. (If
it turns out that this mechanism is useless, we'll just remove it
again.)
2013-06-29 22:58:13 +02:00
wm4 5f664d78e6 core: add libquvi 0.9 support
This adds support for libquvi 0.9.x, and these features:
- start time (part of youtube URL)
- youtube subtitles
- alternative source switching ('l' and 'L' keys)
- youtube playlists

Note that libquvi 0.9 is still in development. Although this seems to
be API stable now, it looks like there will be a 1.0 release, which is
supposed to be the next stable release and the actual successor of
libquvi 0.4.x.
2013-06-28 15:47:35 +02:00
Rudolf Polzer 0cbc75c083 Option -omaxfps: limit fps when encoding
Lower-fps content is left alone (NOT aligned to this fps); higher fps
content is decimated to this frame rate.
2013-06-09 15:37:28 +02:00
Stefano Pigozzi 213ad5d6c4 osx: improve Media Keys support
This commit addresses some issues with the users had with the previous
implementation in commit c39efb9. Here's the changes:

  * Use Quartz Event Taps to remove Media Key events mpv handles from
    the global OS X queue. This prevents conflicts with iTunes. I did this on
    the main thread since it is mostly idling. It's the playloop thread that
    actually does all the work so there is no danger of blocking the event tap
    callback.
  * Introduce `--no-media-keys` switch so that users can disable all of mpv's
    media key handling at runtime (some prefer iTunes for example).
  * Use mpv's bindings so that users can customize what the media keys do via
    input.conf. Current bindings are:

      MK_PLAY cycle pause
      MK_PREV playlist_prev
      MK_NEXT playlist_next

An additional benefit of this implementation is that it is completly handled
by the `macosx_events` file instead of `macosx_application` making the
project organization more straightforward.
2013-06-04 23:02:23 +02:00
Stefano Pigozzi 72f2942dfa osx: add Apple Remote support
After killing the non functional AR support in c8fd9e5 I got much complaints so
this adds AR support back in (and it works). I am using the HIDRemote class by
Felix Schwarz and that part of the code is under the BSD license. I slightly
modified it replacing [NSApplication sharedApplication] with NSApp. The code
of the class is quite complex (probably because it had to deal with all the
edge cases with IOKit) but it works nicely as a black box.

In a later commit I'll remove the deprecation warnings caused by HIDRemote's
usage of Gestalt.

Check out `etc/input.conf` for the default bindings.

Apple Remote functionality is automatically compiled in when cocoa is enabled.
It can be disabled at runtime with the `--no-ar` option.
2013-06-03 22:35:47 +02:00
wm4 4a1f9bdc66 input.conf: fix comment 2013-06-03 00:15:25 +02:00
wm4 ce9a854d54 core: add playback resume feature (manual/opt-in)
A "watch later" command is now mapped to Shift+Q. This quits the player
and stores the playback state in a config file in ~/.mpv/watch_later/.
When calling the player with the same file again, playback is resumed
at that time position.

It's also possible to make mpv save playback state always on quit with
the --save-position-on-quit option. Likewise, resuming can be disabled
with the --no-resume-playback option.

This also attempts to save some playback parameters, like fullscreen
state or track selection. This will unconditionally override config
settings and command line options (which is probably not what you would
expect, but in general nobody will really care about this). Some things
are not backed up, because that would cause various problems. Additional
subtitle files, video filters, etc. are not stored because that would be
too hard and fragile. Volume/mute state are not stored because it would
mess up if the system mixer is used, or if the system mixer was
readjusted in the meantime.

Basically, the tradeoff between perfect state restoration and
complexity/fragility makes it not worth to attempt to implement
it perfectly, even if the result is a little bit inconsistent.
2013-05-05 20:08:11 +02:00
wm4 ff549a2f6a core: add backstep support
Allows stepping back one frame via the frame_back_step inout command,
bound to "," by default.

This uses the precise seeking facility, and a perfect frame index built
on the fly. The index is built during playback and precise seeking, and
contains (as of this commit) the last 100 displayed or skipped frames.
This index is used to find the PTS of the previous frame, which is then
used as target for a precise seek. If no PTS is found, the core attempts
to do a seek before the current frame, and skip decoded frames until the
current frame is reached; this will create a sufficient index and the
normal backstep algorithm can be applied.

This can be rather slow. The worst case for backstepping is about the
same as the worst case for precise seeking if the previous frame can be
deduced from the index. If not, the worst case will be twice as slow.

There's also some minor danger that the index is incorrect in case
framedropping is involved. For framedropping due to --framedrop, this
problem is ignored (use of --framedrop is discouraged anyway). For
framedropping during precise seeking (done to make it faster), we try
to not add frames to the index that are produced when this can happen.
I'm not sure how well that works (or if the logic is sane), and it's
sure to break with some video filters. In the worst case, backstepping
might silently skip frames if you backstep after a user-initiated
precise seek. (Precise seeks to do indexing are not affected.)

Likewise, video filters that somehow change timing of frames and do not
do this in a deterministic way (i.e. if you seek to a position, frames
with different timings are produced than when the position is reached
during normal playback) will make backstepping silently jump to the
wrong frame. Enabling/disabling filters during playback (like for
example deinterlacing) will have similar bad effects.
2013-04-24 20:27:12 +02:00
wm4 4e55a6e828 Remove some apple remote leftovers
The options and key names don't do anything anymore.
2013-04-05 23:59:39 +02:00
Rudolf Polzer 18755dcbea encoding-example-profiles: block non-4:0:0 for baseline h264
libx264 rejects the other pixel formats when doing baseline H.264,
although libavcodec accepts them, leading to an encoding abort.
2013-04-04 09:40:00 +02:00
Rudolf Polzer 47d35ca6be encoding-example-profiles and manpage: prefer libvorbis over vorbis
vorbis is the builtin bad vorbis encoder; whenever possible, one should
rather use the "libvorbis" codec name.
2013-03-31 19:13:06 +02:00
Rudolf Polzer 5d5c5e31e1 encoding-examples-profiles: fix N900 profile
In some cases (when using tune=animation as an additional option), the
N900 profile caused use of 6 reference frames, where Level 3.0 only
allows 5 reference frames. This prevented playback on the Nokia N900.
This has been fixed by always specifying refs=5.
2013-03-20 16:16:16 +01:00
Rudolf Polzer 3ef58d85ba encoding-example-profiles: for Nokia N900, avoid upscaling
This yields generally smaller files, by avoiding upscaling at all times.
This method may or may not be useful for iOS, needs testing there.

Note: this uses three instances of vf_scale:

1. Scale to target dimensions, ONLY if both are <= original video
   dimensions.
2. Failing that, scale to width*<calculated height by display aspect>,
   ONLY if <calculated height by display aspect> <= original video
   height.
3. Failing that, scale to <calculated width by display aspect>*height.
   When the test before failed, we KNOW that <calculated width by
   display aspect> <= original video width.

So basically, only one of the three scalers should ever be active, as
the last two scalers only can ever have an effect if the aspect ratio
mismatches the video.

As for danger of roundoff errors:

If scaler 1 succeeded, we have won. Scalers 2 and 3 will never do
anything, because display resolution == video resolution. Here it is
crucial that no rounding of video size to display size takes place; in
other words, the target display size already MUST be even, which it is
because we pass 2 to the rounding parameter of the dsize filter.

Scaler 2 and 3 are obviously mutually exclusive, as they depend on
opposite aspect ratio conditions.

We later should put this functionality directly into vf_scale...
2013-03-18 13:27:52 +01:00
wm4 df4b31c869 input: ignore normal mouse click by default
Apparently this annoyed some users.
2013-03-14 00:10:15 +01:00
Rudolf Polzer dc226bb846 encoding-example-profiles: add a Nokia N900 profile
Nokia N900 is simply H.264 Baseline, level must be forced to 3.0, at
max. display resolution. There is no pan-scan like on iOS.
2013-03-04 12:14:59 +01:00
wm4 4722446805 input.conf: change default bindings of 5/6 from hue to gamma
I doubt anyone needs to adjust hue on a frequent basis, and gamma is
much more useful.

Suggestions for more radical changes of key bindings are welcome
(there's a lot of useless crap mapped).
2013-03-01 14:56:24 +01:00
wm4 9b7fb867f7 options: drop --opt:subopt option names
For all suboptions, "flat" options were available by separating the
parent option and the sub option with ":", e.g. "--rawvideo:w=123". Drop
this syntax and use "-" as separator. This means even suboptions are
available as normal options now, e.g. "--rawvideo-w=123". The old syntax
doesn't work anymore.

Note that this is completely separate from actual suboptions. For
example, "-rawvideo w=123:h=123" still works. (Not that this syntax is
worth supporting, but it's needed anyway, for for other things like vf
and vo suboptions.)

As a consequence of this change, we also have to add new "no-" prefixed
options for flag suboptions, so that "--no-input-default-bindings"
works. ("--input-no-default-bindings" also works as a consequence of
allowing "-input no-default-bindings" - they are handled by the same
underlying option.)

For --input, always use the full syntax in the manpage. There exist
suboptions other than --input (like --tv, --rawvideo, etc.), but since
they might be handled differently in the future, don't touch these yet.

M_OPT_PREFIXED becomes the default, so remove it. As a minor unrelated
cleanup, get rid of M_OPT_MERGE too and use the OPT_SUBSTRUCT() macro in
some places.

Unrelated: remove the duplicated --tv:buffersize option, fix a typo in
changes.rst.
2013-02-23 00:07:11 +01:00
wm4 4d016a92c8 core: redo how codecs are mapped, remove codecs.conf
Use codec names instead of FourCCs to identify codecs. Rewrite how
codecs are selected and initialized. Now each decoder exports a list
of decoders (and the codec it supports) via add_decoders(). The order
matters, and the first decoder for a given decoder is preferred over
the other decoders. E.g. all ad_mpg123 decoders are preferred over
ad_lavc, because it comes first in the mpcodecs_ad_drivers array.
Likewise, decoders within ad_lavc that are enumerated first by
libavcodec (using av_codec_next()) are preferred. (This is actually
critical to select h264 software decoding by default instead of vdpau.
libavcodec and ffmpeg/avconv use the same method to select decoders by
default, so we hope this is sane.)

The codec names follow libavcodec's codec names as defined by
AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders
have names different from the canonical codec name. The AVCodecDescriptor
API is relatively new, so we need a compatibility layer for older
libavcodec versions for codec names that are referenced internally,
and which are different from the decoder name. (Add a configure check
for that, because checking versions is getting way too messy.)

demux/codec_tags.c is generated from the former codecs.conf (minus
"special" decoders like vdpau, and excluding the mappings that are the
same as the mappings libavformat's exported RIFF tables). It contains
all the mappings from FourCCs to codec name. This is needed for
demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the
codec as determined by libavformat, while the other demuxers have to do
this on their own, using the mp_set_audio/video_codec_from_tag()
functions. Note that the sh_audio/video->format members don't uniquely
identify the codec anymore, and sh->codec takes over this role.

Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which
provide cover the functionality of the removed switched.

Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure
container/video combinations (e.g. the sample Film_200_zygo_pro.mov)
are played flipped. ffplay/avplay doesn't handle this properly either,
so we don't care and blame ffmeg/libav instead.
2013-02-10 17:25:56 +01:00
wm4 c5340512dd core: remove --edlout functionality
This could write .edl files in MPlayer's format. Support for playing
these files has been removed from mplayer2 quite a while ago. (mplayer2
can play its own, "new" .edl format, but does not support writing it.)

Since this is a rather obscure functionality, and it's not really clear
how it should behave (e.g. what should it do if a new file is played),
and wasn't all that great to begin with (what if you made a mistake?
the "edl_mark" command sucks for editing), get rid of it.

Suggestions how to reimplement this in a nicer way are welcome. If it's
just about retrieving timecodes, this in input.conf will do:

    KEY print_text "position: ${=time-pos}"
2013-02-06 23:03:39 +01:00
wm4 7885fce7ea video: add --autofit and --autofit-larger options
--autofit=WxH sets the window size to a maximum width and/or height,
without changing the window's aspect ratio.

--autofit-larger=WxH does the same, but only if the video size is
actually larger than the window size that would result when using
the --autofit=WxH option with the same arguments.
2013-01-23 10:56:36 +01:00
Rudolf Polzer 5bcd52178e encoding-example-profiles: typo fixes
The iPhone profiles recursively included themselves. Wonder why it even
worked somewhat...
2013-01-18 13:58:31 +01:00
wm4 8751a0e261 video: decouple internal pixel formats from FourCCs
mplayer's video chain traditionally used FourCCs for pixel formats. For
example, it used IMGFMT_YV12 for 4:2:0 YUV, which was defined to the
string 'YV12' interpreted as unsigned int. Additionally, it used to
encode information into the numeric values of some formats. The RGB
formats had their bit depth and endian encoded into the least
significant byte. Extended planar formats (420P10 etc.) had chroma
shift, endian, and component bit depth encoded. (This has been removed
in recent commits.)

Replace the FourCC mess with a simple enum. Remove all the redundant
formats like YV12/I420/IYUV. Replace some image format names by
something more intuitive, most importantly IMGFMT_YV12 -> IMGFMT_420P.

Add img_fourcc.h, which contains the old IDs for code that actually uses
FourCCs. Change the way demuxers, that output raw video, identify the
video format: they set either MP_FOURCC_RAWVIDEO or MP_FOURCC_IMGFMT to
request the rawvideo decoder, and sh_video->imgfmt specifies the pixel
format. Like the previous hack, this is supposed to avoid the need for
a complete codecs.cfg entry per format, or other lookup tables. (Note
that the RGB raw video FourCCs mostly rely on ffmpeg's mappings for NUT
raw video, but this is still considered better than adding a raw video
decoder - even if trivial, it would be full of annoying lookup tables.)

The TV code has not been tested.

Some corrective changes regarding endian and other image format flags
creep in.
2013-01-13 20:04:11 +01:00
wm4 58d196c07e video: different way to enable hardware decoding, add software fallback
Deprecate the hardware specific video codec entries (like ffh264vdpau).
Replace them with the --hwdec switch, which requests that a specific
hardware decoding API should be used. The codecs.conf entries will be
removed at a later time, but for now they are useful for testing and
compatibility.

Instead of --vc=ffh264vdpau, --hwdec=vdpau should be used.

Add a fallback if hardware decoding fails. Most hardware decoders
(including vdpau) support only a subset of h264, and having such a
fallback is supposed to enable a better user experience.
2013-01-13 17:39:32 +01:00
wm4 06ccd9f671 video: simplify decoder pixel format handling
Simplify the decoder pixel format handling by making it handle only
the case vd_lavc needs: a video stream always decodes to a single
pixel format.

Remove the handling for multiple pixel formats, and remove the
codecs.conf pixel format declarations that are left.

Remove the handling of "ambiguous" pixel formats like YV12 vs. I420 (via
VDCTRL_QUERY_FORMAT etc.). This is only a problem if the video chain
supports I420, but not YV12, which doesn't seem to be the case anywhere,
and in fact would not have any advantage.

Make the "flip" flag a global per-codec flag, rather than a pixel format
specific flag. (Some ffmpeg decoders still return a flipped image, so
this has to be done manually.) Also fix handling of the flip operation:
do not overwrite the global flip option, and make the --flip option
invert the codec flip option rather than overriding it.
2013-01-13 17:39:31 +01:00
Rudolf Polzer 015548401c encoding-example-profiles: restructure iPhone profiles
The names are left as is, but they are hierarchic internally now.
2013-01-10 11:56:04 +01:00
Rudolf Polzer fd64003c2a encoding-example-profiles: fix "oac" typo
Fixes issue #10.
2012-12-28 11:21:35 +01:00
wm4 071d24e19d audio/decode: remove ad_dvdpcm and use ad_lavc for DVD PCM
ad_dvdpcm reads MPEG specific headers directly (passed through codecdata
by demux_mpg), so you couldn't use ffmpeg's "pcm_dvd" with demux_mpg.
Change demux_mpg to set the correct audio parameters directly. The code
for this is taken from ad_dvdpcm.

ad_dvdpcm is evil because it still does partial packet reads (with
demux_read_data()), and it's redundant to libavcodec anyway.
2012-12-11 00:37:54 +01:00
wm4 2dd2d9bcfc audio/decode: remove ad_pcm and use ad_lavc for PCM
Since libavcodec doesn't have a "generic" PCM decoder, we have to go out
of out way to make it look like ad_lavc provides one: make it provide a
pseudo "pcm" decoder, which maps some format tags manually to the
individual libavcodec PCM decoders.

Format tags which uniquely map to one libavcodec could be mapped via
codecs.conf. Since defining these in tag_map[] is much shorter (one line
vs. a full codec entry in codecs.conf), and since we need tag_map[]
anyway, we don't use codecs.conf for these.

ad_pcm is evil because it still does partial packet reads (with
demux_read_data()), and it's redundant to libavcodec anyway.
2012-12-11 00:37:54 +01:00
wm4 9ace4f1f49 configure: don't check for inttypes.h, it always exists
The presence of inttypes.h is guaranteed by POSIX. We don't need to
check for it. We don't need to provide a compatibility header either.

Apparently libc5 systems didn't provide inttypes.h. libc5 is ancient,
unmaintained, and not used by modern Linux systems.
2012-12-03 21:08:51 +01:00
Rudolf Polzer 96fb9103b5 encoding-example-profiles: updates, iphone 5 support
Now the scaling for iPhones properly optimizes for the zoomed-in
(pan-scan) view.
2012-12-01 19:51:25 +01:00
Rudolf Polzer bb8e3dd0a2 encoding-example-profiles: fix aac bitrate
Now the enc-to-iphone profiles no longer specify the aac bitrate
explicitly (128k), but take over the default from enc-a-aac (96k).
2012-12-01 18:35:06 +01:00
Rudolf Polzer e22f85ade2 encoding-example-profiles: use 96kbps aac
Previously it used 128kbps libfaac by default, but now that we have
libfdk_aac, we can default to 96kbps at better quality than before.
2012-12-01 17:16:51 +01:00
Rudolf Polzer eb12bc4c21 encoding examples: change global_quality use to qscale
global_quality would need an extra multiplication by QP2LAMBDA otherwise
2012-11-15 15:42:06 +01:00
wm4 597a0c70f9 example.conf: all options should be commented
The file is written with the assumption that it doesn't change any
settings by default. Add a forgotten comment to fix this.
2012-11-14 11:48:18 +01:00
wm4 c12f408c47 example.conf: remove some useless options, add some useful ones 2012-11-11 18:10:14 +01:00
wm4 84829a4ea1 Merge branch 'osd_changes' into master
Conflicts:
	DOCS/man/en/options.rst
2012-11-01 02:12:47 +01:00
wm4 5f236b3a82 codecs.conf: cleanup: remove stale entry 2012-10-30 19:50:24 +01:00
wm4 13e84fbcec input: remove default bindings for sub_step
The sub_step command is not that useful, and accidentally hitting it
means that the subtitle delay gets completely messed up.
2012-10-30 19:50:24 +01:00
wm4 0e81d62c53 Merge branch 'master' into osd_changes
Conflicts:
	libvo/vo_xv.c
2012-10-24 22:38:45 +02:00
wm4 48ce4ab7f9 screenshot: change "screenshot" input command
"screenshot" now maps to "screenshot subtitles" by default, instead of
"screenshot video". Swap the argument order: the more useful argument
should come first. Remove the compatibility aliases for numeric choices
(e.g. "screenshot 1 0" won't work anymore).
2012-10-24 21:56:34 +02:00
Stefano Pigozzi 511d5478f9 codecs: add Video Decode Acceleration Framework codec
Video Decode Acceleration Framework is a framework by Apple to provide
GPU assisted H.264 decoding. It is available on Mac OS X v10.6.3 and
later with Mac models equipped with the NVIDIA GeForce 9400M, GeForce 320M,
GeForce GT 330M, ATI HD Radeon GFX, Intel HD Graphics and others.

This commit uses the new video decoder added in FFmpeg based upon this
framework.
2012-10-16 07:19:32 +02:00
Stefano Pigozzi c4f68de145 TOOLS: add script for osx bundle generation
Add a make task and python script to create a Mac OS X Application Bundle
to be used when compiling with the --enable-macosx-finder and
--enable-macosx-bundle configure flags.

The main svg icon was created by me and heavily inspired by Apple's iTunes
and AppStore icon designs. We are still looking for something better.
For the audio, movie and subtitles icons I added the main logo to MPlayer OSX
Extended icons.

Use with `make osxbundle` after running configure and make.
2012-10-16 07:15:12 +02:00
wm4 187cbd7aa7 input: add input test mode
In input test mode, key bindings won't be executed, but are shown on the
OSD.  The OSD includes various information, such as the name of the key,
the command itself, whether it's builtin, and the config file location
it was defined.

The input test mode can be enabled with "--input=test". No effort is
spent trying to react to key bindings that normally exit the player;
they are treated just like any other binding.
2012-10-14 22:28:51 +02:00
wm4 85d185441a Merge branch 'input_changes' into master
Conflicts:
	DOCS/man/en/vo.rst
	etc/input.conf
	input/input.c
	m_property.c
2012-10-12 11:53:53 +02:00
wm4 65fc530f0c Rename to "mpv"
This changes the name of this project to mpv. Most user-visible mentions
of "MPlayer" and "mplayer" are changed to "mpv". The binary name and the
default config file location are changed as well.

The new default config file location is: ~/.mpv/

Remove etc/mplayer.desktop. Apparently this was for the MPlayer GUI,
which has been removed from mplayer2 ages ago.

We don't have a logo, and the MS Windows resource files sort-of require
one, so leave etc/mplayer.ico/.xpm as-is.

Remove the debian and rpm packaging scripts. These contained outdated
dependencies and likely were more harmful than useful. (Patches which
add working and well-tested packaging are welcome.)
2012-10-12 10:14:32 +02:00
wm4 e1b15dee4c commands: use "up" and "down" as 2nd argument for cycle command
Allow the values "up" and "down" as step argument for the cycle input
command. Previously, this argument was a float, which specified an
arbitrary step value and direction (similar to the add command).
Instead of "1" and "-1", "up" and "down" is to be used.

Float values are still accepted. That capability might be removed in the
future, as there's probably hardly any actual use for arbitrary step
values.
2012-10-12 10:13:43 +02:00
wm4 46e8d33809 commands: make exact seeking default bindings not use OSD
The OSD bar is very annoying when seeking. Especially when the seeks
are very small, the OSD doesn't show any interesting information. The
exact seeking commands are a use case where the user definitely never
wants to see a seek bar.
2012-10-12 10:10:32 +02:00
wm4 88849fd1d4 commands: add choice type to input commands
Allow using the choice type (as it used for command line) for arguments
of input commands. Change the magic integer arguments of some commands
(like seek) to use choices instead. The old numeric values are still
allowed (but only those which made sense before, not arbitrary
integers).

In order to do this, remove the input.c specific types (like
MP_CMD_ARG_INT) completely and specify commands using the m_option
types.

Also, add the special choice "-" to some arguments. It's supposed to
signify the default value, so arguments can be easily skipped. Maybe the
choice option should recognize this and not change the previous value,
but we'll leave this for later.

For now, leave compatibility integer values for all new choice
arguments, e.g. "0" maps to 0. We could let the choice option type do
this automatically, but we don't, because we want user input values and
internal mplayer values decoupled in general. The compatibility options
will be removed one day, too.

Also, remove optional args for strings - would require either annoying
additional code, or copying strings twice. It's not used, so remove it.
2012-10-12 10:10:32 +02:00
wm4 d232012287 input: handle escapes always in command parser
Previously, both the command parser and property expansion
(m_properties_expand_string) handled escapes with '\'. Move all escape
handling into the command parser, and remove it from the property code.

This removes the need to escape strings twice for commands that use
property expansion.

The command parser is practically rewritten: it uses m_option for the
actual parsing, and reduces hackish C-string handling.
2012-10-12 10:10:32 +02:00