Commit Graph

38361 Commits

Author SHA1 Message Date
wm4 f9f89b9049 demux_raw: remove global option variables 2014-06-11 00:39:13 +02:00
wm4 099cdbf019 demux_mf: remove global option variables 2014-06-11 00:39:13 +02:00
wm4 fd5207f56d options: remove global variables for swscale options; rename them
Additionally to removing the global variables, this makes the options
more uniform. --ssf-... becomes --sws-..., and --sws becomes --sws-
scaler. For --sws-scaler, use choices instead of magic integer values.
2014-06-11 00:39:13 +02:00
wm4 2fc3be582c stream_dvd: minor cleanups
We don't need a separate stream_dvd.h header file anymore. Some dead
functions become apparent; remove them.
2014-06-11 00:39:13 +02:00
wm4 35e6d1abe0 stream_dvd, stream_dvdnav, stream_bluray: remove global option variables 2014-06-11 00:39:06 +02:00
wm4 959b718957 stream_dvb: remove global option variables 2014-06-11 00:35:03 +02:00
wm4 77a7aa2c41 stream_cdda: remove global option variables 2014-06-11 00:34:46 +02:00
wm4 7689f5f7ce stream: add a generic way to setup stream priv defaults
Usually, each stream driver declares the size and option list of its
private data. This was pretty natural for when most streams still used
global variables to setup their defaults. They did by pointing
priv_defaults to the (mutable) struct containing the option values. But
falls short when storing the option values in MPOpts. So provide a
somewhat inelegant but simple way to let the stream implementation setup
the priv struct at initialization time.

This is done with the get_defaults callback. It should return a copy of
the struct used in MPOpts. (A copy, because if MPOpts is changed, string
fields might be deallocated, and if that field is not described by
stream_info.options, it won't be copied on init.)
2014-06-11 00:34:46 +02:00
wm4 73ac34b220 stream_pvr: remove global option variables 2014-06-11 00:34:42 +02:00
wm4 fcf9bb95b5 tv: remove printing of useless comment information 2014-06-11 00:34:42 +02:00
wm4 383cf20785 tv: remove global option variables
Pretty much nothing changes, but using -tv-scan with suboptions doesn't
work anymore (instead of "-tv-scan x" it's "-tv scan-x" now). Flat
options ("-tv-scan-x") stay compatible.
2014-06-11 00:34:42 +02:00
wm4 98c0930f9b m_config: add function to copy subopt-struct 2014-06-11 00:34:41 +02:00
wm4 e033f3c8bc command: redo ancient TV/DVB/PVR commands
Convert all these commands to properties. (Except tv_last_channel, not
sure what to do with this.) Also, internally, don't access stream
details directly, but dispatch commands with stream ctrls.

Many of the new properties are a bit strange, because they're write-
only. Also remove some OSD output these commands produced, because I
couldn't be bothered to port these.

In general, this makes everything much cleaner, and will also make it
easier to e.g. move the demuxer to its own thread.

Don't bother updating input.conf, but changes.rst documents how old
commands map to the new ones.

Mostly untested, due to lack of hardware.
2014-06-11 00:34:41 +02:00
ChrisK2 9420eb5a07 osd: Center the volume icon in the osd font 2014-06-10 02:16:46 +02:00
wm4 9d3232e058 build: disable zsh completions by default, fixes e.g. cross compilation
The Perl script generating the completions actually invokes mpv, and it
runs during the build. This is not sane and breaks at least cross
compilation.

As a workaround, disable the completions by default for now.
2014-06-09 15:17:03 +02:00
wm4 ce0bf5e7dd player: hide some messages in verbose mode
This started getting annoying.
2014-06-09 01:21:13 +02:00
wm4 e1d846263a video: fix another cover art corner case
Playing a video and then an audio file with cover art kept displaying
the last frame of the video. This was because the hasframe flag was set,
perhaps due to redrawing the last video frame before the cover art image
is decoded.
2014-06-09 01:21:08 +02:00
wm4 adea4386bc client API: disable LIRC input by default
Not only should using libmpv hog such global resources; it's also very
unlikely an application embedding mpv will ever want to make use of
this.
2014-06-09 01:20:55 +02:00
wm4 3e2f16a89e audio: add a "weak" gapless mode, and make it default
Basically, this allows gapless playback with similar files (including
the ordered chapter case), while still being robust in general.

The implementation is quite simplistic on purpose, in order to avoid
all the weird corner cases that can occur when creating the filter
chain. The consequence is that it might do not-gapless playback in
more cases when needed, but if that bothers you, you still can use
the normal gapless mode.

Just using "--gapless-audio" or "--gapless-audio=yes" selects the old
mode.
2014-06-09 01:20:53 +02:00
wm4 da89af1076 player: show "neutral" position markers for OSD bars
This commit implements them for volume and some video properties.
2014-06-08 23:52:58 +02:00
Alessandro Ghedini cc74bc3fec build: generate and install zsh completion script 2014-06-08 20:48:42 +02:00
Alessandro Ghedini da27eceb85 TOOLS: add script for generating a zsh completion script
As discussed in #775
2014-06-08 20:48:39 +02:00
wm4 09dd1ed47c client API: minor documentation fixes/enhancements 2014-06-08 16:11:39 +02:00
wm4 51834592fc client API: trigger wakeup when creating wakeup pipe/callback
Since redundant wakeups are avoided now, it's easy to miss a wakeup when
creating/setting the pipe/callback after the client API was signalled.
If the client API is signalled, need_wakeup is set to true, and
wakeup_client skips writing to the pipe or calling the client API. That
this can happen is not very obvious to the client API, so trigger a
wakeup right on start in order to remove this special case.
2014-06-08 16:11:11 +02:00
wm4 f118d2af6a manpage: document new --sub-file semantics
This was forgotten in the previous commit.
2014-06-08 00:20:58 +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 5cc68c792b client API: restructure waiting, do log msg wakeup properly
Until now, availability of new log messages (through the mechanism
associated with mpv_request_log_messages()) did not wakeup the client
API properly. Commit 3b7402b5 was basically a hack to improve that
somewhat, but it wasn't a solution.

The main problem is that the client API itself is producing messages, so
the message callback would attempt to lock the client API lock,
resulting in a deadlock. Even if the lock was recursive, we'd run into
lock-order issues.

Solve this by using a separate lock for waiting and wakeup. Also, since
it's a natural addition, avoid redundant wakeups. This means the wakeup
callback as well as the wakeup pipe will be triggered only once until
the next mpv_wait_event() call happens.

This might make the wakeup callback be invoked in a reentrant way for
the first time, for example if a mpv_* function prints to a log. Adjust
the docs accordingly. (Note that non-reentrant beheavior was never
guaranteed - basically the wakeup callback is somewhat dangerous and
inconvenient.)

Also remove some traces of unneeded code. ctx->shutdown for one was
never set, and probably a leftover of an abandoned idea.
2014-06-07 23:16:46 +02:00
wm4 fca608ccb9 client API: rename mpv_destroy() to mpv_detach_destroy()
A bit verbose, but less misleading. In most cases, the API user probably
actually wants mpv_terminate_destroy() instead, so the less-useful
function shouldn't have a simnpler name anyway.
2014-06-07 20:25:48 +02:00
wm4 0b9468f65f client API: clarify mpv_get_wakeup_pipe docs
It wasn't necessarily clear how this works. Especially make clear that
the API user shouldn't expect that there's one byte per readable event
in the wakeup pipe. Actually, the reason why this currently won't work
is because property notifications can generate more events than wakeups.
The limit of 4096 is a more fundamental issue, but the event ringbuffer
is currently limited to 1000 entries anyway.

Also add some important comments to mpv_set_wakeup_callback.
2014-06-07 20:13:01 +02:00
wm4 500ce69a06 client API: add API function that ensures total destruction
mpv_destroy() should perhaps better be called mpv_detach(), because it
destroys only the handle, not necessarily the player. The player is only
terminated if a quit command is sent.

This function quits automatically, and additionally waits until the
player is completely destroyed. It removes the possibility that the
player core is still uninitializing, while all client handles are
already destroyed. (Although in practice, the difference is usually not
important.)
2014-06-07 15:57:54 +02:00
wm4 d64bd9efa1 client API: docs: some clarifications 2014-06-07 15:57:54 +02:00
wm4 a1000962e3 client API: change mpv_wait_event() timeout semantics
Now a negative timeout mean an infinite timeout. This is similar to the
poll() system call. Apparently this is more intuitive and less confusing
than specifying a "very high" value as timeout if you want to wait
forever.

For callers that never pass negative timeouts, nothing changes.
2014-06-07 15:57:47 +02:00
wm4 60e0833f1f build: prevent installation of client API example
This was never intended to be installed; waf just picked it up
automagically. There's also a closed ticket on github where someone
complains that the program "simple" is installed, and I didn't realize
at this point that it was actually installed by default when enabling
the client API.
2014-06-06 19:43:53 +02:00
wm4 43d46a28fe client API: enlarge the message buffer if log level is high 2014-06-06 19:25:52 +02:00
wm4 3b7402b51c client API: call wakeup callback if there are new messages
Listening on messages currently uses polling (every time
mpv_wait_event() has no new events, the message buffer is polled and a
message event is possibly created). Improve this situation a bit, and
call the user-supplied wakeup callback.

This will increase the frequency with which the wakeup callback is
called, but the client is already supposed to be able to deal with this
situation. Also, as before, calling mpv_wait_event() from the wakeup
callback is forbidden, so the client can't read new messages from the
callback directly.

The wakeup pipe is written either. Since the wakeup pipe is created
lazily, we can't access the pipe handle without creating a race
condition or a deadlock. (This is actually very silly, since in practice
the race condition won't matter, but for now let's keep it clean.)
2014-06-06 19:24:30 +02:00
wm4 79e76abb4d x11: cleanup motif hints handling
It seems we can't really get rid of this. There are no other hints to
remove decorations that work across all reasonable WMs, so we're stuck
with the ugly motif stuff.

But at least we can make the code for it less ugly.
2014-06-06 18:45:38 +02:00
wm4 cdcdddfc63 client API: fix terminal usage
By default this is disabled. But if it's enabled, then we have to
account for proper states when enabling/disabling the terminal state
itself.
2014-06-06 17:28:13 +02:00
wm4 ecbb12923f client API: don't update properties in uninitialized state
If an API user calls mpv_wait_event() and mpv_observe_property() before
mpv_initialize(), it could happen that a property was accessed before
initialization, which is not ok.
2014-06-06 17:27:05 +02:00
wm4 4279712d1e client API: don't use the mpv config files by default
This was always intended this way, and even documented in client.h. Due
to an oversight it was never actually implemented.

The intention is that mpv embedded in applications and "real mpv" don't
conflict. An API user can undo this by setting the "config" option to
"yes", if using the user's mpv config is desired.
2014-06-06 17:26:01 +02:00
wm4 7716424d48 client API: use shared code for creating the wakeup pipe
Should be equivalent, reduces code duplication.
2014-06-06 17:22:53 +02:00
wm4 662592c860 client API: fix swapped pipe ends used with mpv_set_wakeup_callback
This was extremely wrong. It was never tested because nobody ever used
it (the feature was added for someone who never tried it in the end).
2014-06-06 17:21:30 +02:00
wm4 a854583b57 input: don't print warning when aboting playback via commands
I don't really see a reason for this.
2014-06-06 17:17:22 +02:00
wm4 aafc03aab3 wscript: update waf version check to the version in bootstrap.py 2014-06-06 17:13:50 +02:00
wm4 b4c1699aaf sub: remove old style override option
Didn't work too well.
2014-06-05 01:10:48 +02:00
wm4 015399f696 sub: add --ass-style-override=force option
(The old "force" choice of that option is renamed to "force-default".)

This allows overriding native ASS script subtitle styles with the style
provided by the --sub-text-* options (like --sub-text-font etc.). This
is disabled by default, and needs to be explicitly enabled with the
--ass-style-override=force option and input property.

This uses in fact exactly the same options (--sub-text-*) and semantics
as the ones used to configure unstyled text subtitles.

It's recommended to combine this with this in the mpv config file:

ass-force-style="ScaledBorderAndShadow=1"   # work around dumb libass behavior

Also, adding a key binding to toggle this behavior should be added,
because overriding can easily break:

L cycle ass-style-override

This would cycle override behavior on Shift+L and allows quickly
disabling/enabling style overrides.

Note: ASS should be considered a vector format rather than a subtitle
format. There is no easy or reliable way to determine whether the style
of a given subtitle event can be changed without destroying visuals or
not. This patch relies on a simple heuristic, which often works and
often breaks.
2014-06-05 01:10:37 +02:00
wm4 e82af029a9 stream/cache: handle failure of seeking underlying stream
This could for example happen when serving an incomplete file from http,
and the demuxer tries reading data from the end of the file when opening
it (e.g. with avi). Seeking past EOF fails with http, so the file could
never be opened, and the cache would get stuck trying to seek to the
position.

We can't really make the cache report seek failure directly (it would
suck for various reasons), so just make the cache report EOF if seeking
fails.
2014-06-05 00:19:50 +02:00
wm4 99e498611e lua: make warning about unknown scripts -v only 2014-06-04 00:33:17 +02:00
wm4 80907d007b filter_kernels: fix nearest scaler
The previous commit assumed the filter would be 1x1 (then constant
weight is correct) - but our code in fact uses at least a 2x2 filter. A
1x1 filter would generally be useless, except for nearest scaling - so
it didn't exist.

Insteasd of adding such a 1x1 filter, just turn the nearest weight
function into a scare function, which should take care of the issue.
2014-06-04 00:23:31 +02:00
lucy a3b466e88d filter_kernels: add nearest neighbour scaling
This is useful for playing content containing pixel art that hasn't been
pre-scaled, such as TASVideos' high quality encodes. The implementation is
lifted from <https://code.google.com/p/glumpy/source/browse/glumpy/image/filter.py#413>.
2014-06-03 23:00:24 +02:00
wm4 35f87dc692 audio/out/push: don't attempt to fill AO buffer when paused
Doing so will implicitly resume playback. Broken in commit 5929dc45.
2014-06-03 15:58:25 +02:00