Commit Graph

522 Commits

Author SHA1 Message Date
wm4 3be39ed76c stream_radio: fix some things
Using the radio set/step channel commands would have crashed (that was
broken for about a year, nobody ever noticed). The "capture" part of
a radio:// URI was incorrectly passed (this was broken quite recently).

Still couldn't test it fully. I have no radio device. I suspect nobody
uses this feature or will ever use it again.
2013-08-05 19:18:22 +02:00
wm4 ee2e3b3374 core: change speed option/property to double
The --speed option and the speed property used float. Change them to
double.

Change the commands that manipulate the property (speed_mult/add) to
double as well. Since the cycle command shares code with the add
command, we change that as well.

The reason for this change is that this allows better control over
speed, such as stepping by semitones. Using floats is also just plain
unnecessary.
2013-08-05 00:00:26 +02:00
wm4 cccfac47a4 demux_lavf: make avio buffer configurable
Perhaps not very useful, but reserved for situations when a user reports
awful latency and experimentation/debugging might be required to find
out why or to fix it (happens often).
2013-08-04 23:25:54 +02:00
wm4 56fec5ad3a option: fix inverted --mouseinput option
Also fixes --no-mouseinput.
2013-08-03 14:56:28 +02:00
wm4 2710ae8017 command: make vf and af commands more verbose
On success, print the filter chain on the OSD. Otherwise, show an error
message on the OSD (just enough so that the user knows whether the
command worked).
2013-08-03 14:56:27 +02:00
wm4 cdc6810e59 command: add vf/af properties 2013-08-03 14:47:33 +02:00
wm4 ef3c5a75ab command: split filter changing in two functions
One function sets a raw filter list, the other allows "editing" the
filter list.
2013-08-03 14:47:32 +02:00
wm4 d1c563c0a9 options: don't make options set during playback file local (e.g. --vf)
Refactor file local options handling: instead of making all options
implicitly file local between loading a file and terminating playback,
explicitly make options file local which are required to be file local.

Or in other words, introduce a M_SETOPT_BACKUP flag, which forces file
local-ness when setting an option, and use this for file local command
line options, per-file config files, and per-protocol/extension/vo/ao
profiles.

In particular, this changes the "vf" input command such that video
filters stay permanent even when going to the next file in the playlist.
The underlying reason for this is that the "vf" command uses the option
setting command. This influences the "af" command as well.
2013-08-02 18:00:38 +02:00
wm4 bd0454c31d m_option.c: fix typo in message 2013-08-02 17:06:49 +02:00
wm4 4e45fbed24 m_config: minor simplification
The optstruct parameter in the m_config_parse_option functions was not
needed.
2013-08-02 17:06:43 +02:00
wm4 f8589c9889 Remove m_struct
Not needed anymore.
2013-08-02 17:03:13 +02:00
wm4 bc1d61cf42 stream: redo URL parsing, replace m_struct usage with m_config
Move the URL parsing code from m_option.c to stream.c, and simplify it
dramatically. This code originates from times when http code used this,
but now it's just relict from other stream implementations reusing this
code. Remove the unused bits and simplify the rest.

stream_vcd is insane, and the priv struct is different on every
platform, so drop the URL parsing. This means you can't specify a track
anymore, only the device. (Does anyone use stream_vcd? Not like this
couldn't be fixed, but it doesn't seem worth the effort, especially
because it'd require potentially touching platform specific code.)
2013-08-02 17:02:34 +02:00
Andre D bda5e6d9fd mplayer: add more verbose exit codes 2013-08-02 13:00:25 +02:00
Stefano Pigozzi 3449e893e1 audio/out: add support for new logging API 2013-08-01 20:32:49 +02:00
wm4 03bef3adfd video/out: use new mp_msg stuff for vo.c and vo_opengl
The first step; also serves as example.
2013-07-31 21:46:40 +02:00
wm4 88d79fc00d mp_msg: introduce new log functions and macros
This has two goals:
1. Getting rid of global variables to make the core library-safe.
2. Getting rid of all the MSGT_* constants and the inconsistent
   prefixes spread throughout the source code.

Both goals are not immediately reached with this commit. It's a huge
transition that will take time. There are over >2500 mp_msg calls in the
source, which all have to be replaced for this to work.

The inconsistent prefixes are in particular annoying. Lots of code
manually prefixes messages, e.g. mp_msg(MSGT_VO, MSGL_V, "[vo] ...").
Sometimes the prefixes don't even follow this convention (for example
vo_direct3d.c uses "<vo_direct3d>" as prefix). This commit allows
automatically adding prefixes on request, so consistency will
hopefully improve.

For now, this commit adds unused stuff, and behavior should not change.

In mplayer.c, move the GetCpuCaps() call, because that used mp_msg()
before mp_msg_init() was run.
2013-07-31 21:46:40 +02:00
wm4 d1de1e090f options: handle presets directly in m_config
This means that "mpv -vo opengl-hq:help" will actually show the correct
defaults, instead those of plain vo_opengl.
2013-07-31 20:56:00 +02:00
wm4 d6592dd2e2 m_option: fix skipping of missing -vo/-ao entries
The -vo/-ao options support skipping of unknown entries for the sake of
allowing using the same config on possibly very different systems, which
have different sets of VO/AOs available.

Unfortunately skipping didn't quite work, possibly a rebase error when
this was originally committed. Fix it.
2013-07-31 20:55:59 +02:00
wm4 a8a0c5023b m_config: remove alias information
We don't need to store anymore whether an option is aliased by another
option (which is what the alias_owner member did). Also, that member
had a really bad name.

This also removes some unneeded code from config_destroy(). Calling
m_option_free() is always ok; this just skipped the call if it did
nothing. In particular, it's ok to call m_option_free() on the same
pointer multiple times. (Maybe that function is misnamed, and it should
be m_option_clear().)
2013-07-31 20:55:59 +02:00
wm4 0656411e97 m_config: store file local backup options differently
File local options need to backup the global option value while a file
is played. Instead of keeping a pointer in m_config_option for the
backup value, put it into a separate list. This reduces per-option
overhead for a rarely used obscure feature. (This implementation would
have been a bit dumb in pre-mpv m_config, because there local options
were the default, and _all_ options were backed up when starting
playback of a file. This is not the case anymore, and normally only
a very small number of options are backed up by default.)
2013-07-31 20:53:00 +02:00
wm4 42f06fb915 m_config: make m_profile struct non-public 2013-07-31 20:43:31 +02:00
wm4 5f9aa74279 command: silence a warning
This is unreachable code, but the compiler doesn't always determine
this. This change shuts up the warning in these cases.
2013-07-29 01:03:36 +02:00
wm4 5accc5e7c1 vdpau: split off decoder parts, use "new" libavcodec vdpau hwaccel API
Move the decoder parts from vo_vdpau.c to a new file vdpau_old.c. This
file is named so because because it's written against the "old"
libavcodec vdpau pseudo-decoder (e.g. "h264_vdpau").

Add support for the "new" libavcodec vdpau support. This was recently
added and replaces the "old" vdpau parts. (In fact, Libav is about to
deprecate and remove the "old" API without deprecation grace period,
so we have to support it now. Moreover, there will probably be no Libav
release which supports both, so the transition is even less smooth than
we could hope, and we have to support both the old and new API.)

Whether the old or new API is used is checked by a configure test: if
the new API is found, it is used, otherwise the old API is assumed.

Some details might be handled differently. Especially display preemption
is a bit problematic with the "new" libavcodec vdpau support: it wants
to keep a pointer to a specific vdpau API function (which can be driver
specific, because preemption might switch drivers). Also, surface IDs
are now directly stored in AVFrames (and mp_images), so they can't be
forced to VDP_INVALID_HANDLE on preemption. (This changes even with
older libavcodec versions, because mp_image always uses the newer
representation to make vo_vdpau.c simpler.)

Decoder initialization in the new code tries to deal with codec
profiles, while the old code always uses the highest profile per codec.

Surface allocation changes. Since the decoder won't call config() in
vo_vdpau.c on video size change anymore, we allow allocating surfaces
of arbitrary size instead of locking it to what the VO was configured.
The non-hwdec code also has slightly different allocation behavior now.

Enabling the old vdpau special decoders via e.g. --vd=lavc:h264_vdpau
doesn't work anymore (a warning suggesting the --hwdec option is
printed instead).
2013-07-28 19:25:07 +02:00
wm4 0293eac84a m_config: try to print min/max values as integers in --list-options
This switched to exponential representation too soon, and large integer
values looked bad in the --list-options output.
2013-07-28 18:56:49 +02:00
wm4 a737308f73 m_config: hide no-* opts in --list-options, simplify positional subopts
All these --no-... options in --list-options made the output rather
unreadable, so hide them. Make the code for finding positional
parameters (which are supposed to skip these no-* options) slightly
simpler too.
2013-07-28 18:56:48 +02:00
wm4 85bee4f071 options: print default values in --list-options
Do this by recreating the m_config from scratch, which then must
contain the default values. This doesn't quite work with legacy options
using global variables: the default values get lost, so using
--list-options will print the value as set by the config file. This
also introduces a memory leak for string options backed by global
variables. All of these issues will be eventually fixed by moving all
options to structs.
2013-07-28 18:56:09 +02:00
wm4 c070fa865f m_config: refactor some things
Change how m_config is initialized. Make it more uniform; now all
m_config structs are intialized in exactly the same way. Make sure
there's only a single m_option[] array defining the options, and keep
around the pointer to the optstruct default value, and the optstruct
size as well. This will allow reconstructing the option default values
in the following commit.

In particular, stop pretending that the handling of some special options
(like --profile, --v, and some others) is in any way elegant, and make
them explicit hacks. This is really more readable and easier to
understand than what was before, and simplifies the code.
2013-07-28 18:44:21 +02:00
wm4 da2b4aa587 core: make mpctx->opts a pointer
Prevents some awkwardness in a later commit, and makes the code more
uniform with other places where MPOpts is accessed.

This is a pretty annoying commit (touches tons of lines all over the
place), but it hurts only once.
2013-07-28 18:44:21 +02:00
wm4 2fc07dcf30 command: mark special options as unavailable
Special options (like -v, -playlist, etc.) don't have data associated
with them, so reading them with the "options" property makes no sense.
2013-07-28 18:44:21 +02:00
wm4 3bddc16431 options: simplify --correct-pts handling
Remove the (now unused) code for determining correct-pts mode based on
the demuxer in use. Change its description in the manpage to reflect
what this option does now.
2013-07-26 02:11:34 +02:00
wm4 bd1d3eaacb command: allow printing time properties with milliseconds
Doing e.g. show_text "${time-pos/full}" will show the time formatted
with a milliseconds part.

This is actually special cased for a few properties which use
CONF_TYPE_TIME, instead of making all properties using CONF_TYPE_TIME
respect this. This is a technical limitation.

I'm not entirely happy with this approach, so I'll leave it
undocumented. It's relatively ok, but he fact that it's special-cased to
some properties is not elegant. So for now, this is just a hack to make
ChrisK2 happy (hi there).
2013-07-26 00:19:15 +02:00
wm4 d1d6db25c0 command: add pseudo-property that allows you to read global options
The "options" pseudo-property allows reading global like this:

   show_text ${options/name}

Where "name" maps to the option "--name". This allows retrieving option
values that are not properties. Write-access is not possible: this is
reserved for normal properties.

Note: it is possible that we'll change this again, and don't require the "options/" prefix to access options.
2013-07-26 00:19:15 +02:00
wm4 ad1641c0da m_property: fix non-sense code
Undefined behavior.
2013-07-26 00:19:15 +02:00
Diogo Franco (Kovensky) 5586b02931 getch2, mplayer: Always call load_termcap
getch2 now deals with the cases where we don't have termcap. Add a dummy
load_termcap to getch2-win so we don't get linking errors on mingw.
2013-07-25 12:23:40 -03:00
Diogo Franco (Kovensky) 2c07cb0036 mp_msg: Support colors on cygwin
A cygwin mpv will usually run inside mintty, and even if it were to be run
in a regular console window, the cygwin dll emulates ANSI escapes.
2013-07-24 23:59:05 -03:00
wm4 31c271f4ad m_config: don't override profile option if not required
The --profile top-level option is handled specially in m_config.c. But
this code also broke sub-options that happened to be named "profile"
(e.g. when trying to use "-af-add=bs2b=profile=cmoy"). Handle it
specially only if it's the top-level --profile option.
2013-07-24 19:44:10 +02:00
wm4 837377a6ce input: fix dangling pointer issues with multi-part commands
This didn't setup the linked list of sub-commands for multi-part
commands ("a ; b ; c") correctly. Also, the new commands were attached
to the allocation of the _old_ command instead of the new one. (Wow,
whatever the hell I was (not) thinking when I wrote this code.)
2013-07-24 19:43:31 +02:00
wm4 782d5ec3a0 mplayer: remove dead code
Attached pictures are now handled specially and on a separate codepath,
so this hack is not needed anymore. Remove it from the normal codepath.
2013-07-24 19:41:24 +02:00
wm4 e83cbde1a4 Fix some -Wshadow warnings
In general, this warning can hint to actual bugs. We don't enable it
yet, because it would conflict with some unmerged code, and we should
check with clang too (this commit was done by testing with gcc).
2013-07-23 00:45:23 +02:00
wm4 78ebb3c6fa options: make legacy hacks for AFs/VFs more explicit
This means that AOs/VOs with no options set do not take the legacy
option parsing path, but instead report that they have no options.
2013-07-22 23:07:23 +02:00
wm4 1df2ad7e03 Remove subopt-helper
Finally not used by anything anymore. Farewell.
2013-07-22 22:42:55 +02:00
wm4 d967649e84 mplayer: cosmetics: move function
Also get rid of the useless comment.
2013-07-22 15:13:04 +02:00
wm4 a48f7a546c av_log: restore handling of prefixes and line breaks
Commit 9a83d03 accidentally removed this. (Overlooked "static"?)

The handling of this rather sucks. Maybe a better solution will be
possible once we clean up the mp_msg code.
2013-07-22 15:11:04 +02:00
wm4 b3dff29001 core: make --demuxer not affect external subtitles
This also affects --audiofile. The previous behavior wasn't really
useful. There are even separate switches for that: --audio-demuxer and
--sub-demuxer.
2013-07-22 15:11:04 +02:00
wm4 3b8dfddb4c audio/filter: use new option API
Make the VF/VO/AO option parser available to audio filters. No audio
filter uses this yet, but it's still a quite intrusive change.

In particular, the commands for manipulating filters at runtime
completely change. We delete the old code, and use the same
infrastructure as for video filters. (This forces complete
reinitialization of the filter chain, which hopefully isn't a problem
for any use cases. The old code forced reinitialization too, but it
could potentially allow a filter to cache things; e.g. consider loaded
ladspa plugins and such.)
2013-07-22 15:11:03 +02:00
wm4 5e0ee41617 options: move --colorkey option to vo_xv 2013-07-22 01:50:22 +02:00
wm4 5b91ba0a8d options: remove --mixer and --mixer-channel, turn them into alsa/oss subopts
These two options were supported by ALSA and OSS only. Further, their
values were specific to the respective audio systems, so it doesn't make
sense to keep them as top-level options.
2013-07-21 23:35:14 +02:00
wm4 3cdf4cf14d options: hide encoding AO/VO in help output
These can't be used manually. Encoding is enabled with -o instead, and
the encoding AO/VO is selected using internal mechanisms.
2013-07-21 23:27:31 +02:00
wm4 7eba27c125 options: use new option code for --ao
This requires completely refactoring the AO creation code too.
2013-07-21 23:27:31 +02:00
wm4 9e1331f7af mplayer: simplify AO creation
The AO creation part was split into two separate parts (one calling
ao_create and one calling ao_init). This didn't really have good
reasons, and obfuscates how AO creation works. Put them together.
2013-07-21 23:27:31 +02:00