Commit Graph

41293 Commits

Author SHA1 Message Date
wm4 19ab5f7943 ipc: silence some common info messages
They are not really interesting. At least one user complained about the
noise resulting from use with shell scripts, which connect and
disconnect immediately.
2015-05-05 01:11:16 +02:00
wm4 4d8a7e0394 ao_coreaudio: support padded channel layouts
If for example the audio settings are set to 5.1 output, but the
hardware does 8 channels natively (HDMI), the reported channel
layout will have 2 dummy channels. To avoid falling back to stereo,
we have to write audio in this format to the device.
2015-05-05 01:11:16 +02:00
wm4 06050aed99 audio: introduce support for padding channels
Some audio APIs explicitly require you to add dummy channels. These are
not rendered, and only exist for the sake of the audio API or hardware
strangeness. At least ALSA, Sndio, and CoreAudio seem to have them.

This commit is preparation for using them with ao_coreaudio.

The result is a bit messy. libavresample/libswresample don't have good
API for this; avresample_set_channel_mapping() is pretty useless.
Although in theory you can use it to add and remove channels, you
can't set the channel counts. So we do the ordering ourselves by making
sure the audio data is planar, and by swapping the plane pointers. This
requires lots of messiness to get the conversions in place. Also, the
input reordering is still done with the "old" method, and doesn't
support padded channels - hopefully this will never be needed. (I tried
to come up with cleaner solutions, but compared to my other attempts,
the final commit is not that bad.)
2015-05-05 01:11:16 +02:00
wm4 1b0b094ca2 audio: introduce mp_audio readonly bit
Convenience for the following commit.
2015-05-04 23:57:25 +02:00
wm4 937c8e513f audio: chmap: explicitly drop channels not supported by lavc
Basically as before, but avoid undefined behavior.
2015-05-04 23:56:27 +02:00
wm4 548cd826c2 audio: drop unused function 2015-05-04 23:54:53 +02:00
wm4 eead97f103 ao_coreaudio: fix out of bounds access
ca_label_to_mp_speaker_id() checked whether the last entry was >= 0, but
actually this condition was never true, and MP_SPEAKER_ID_UNKNOWN0 is
not negative.
2015-05-04 23:54:38 +02:00
James Ross-Gowan b6381a0ee3 subprocess-win: use the correct pipe namespace
This was a mistake, it should definitely be using the device namespace
rather than the file namespace. As it says in the docs, all pipe names
must start with \\.\pipe\
2015-05-04 09:24:53 +02:00
Niklas Haas 08d3ef3d9e
sws_utils: re-use avcolorspace for sws colorspaces
This lets us avoid having to maintain two separate copies of the
colorspace mapping functions.
2015-05-04 01:34:25 +02:00
wm4 a2da53027b win32: fix desktop directory
The folder argument wasn't used, so it always returned the APPDATA dir.
2015-05-03 19:28:14 +02:00
wm4 e25ecdd09a vo_opengl: gl_lcms: fix cache dir creation with path expansion
Path expansion (like "~/dir/" in config file) was used inconsistently,
so the cache directory wasn't always created correctly. Fix this by
moving the path expansion from load_file() to its callers.
2015-05-03 14:58:18 +02:00
wm4 2ae96f567c path: start special espansion with ~~name instead of ~name
Since commit 7381db60, strings like "~desktop/" were expanded as
platform-specific paths by mpv. Apparently this similarity to standard
Unix shell expansion caused confusion, so change it to "~~desktop/". The
shell doesn't expand this, so it should be better.
2015-05-03 14:52:11 +02:00
wm4 6a03357b71 options: fix typo in variable name 2015-05-03 14:44:42 +02:00
wm4 1982fedca6 options: remove --leak-report
Use the environment variable instead.
2015-05-02 19:03:28 +02:00
wm4 3508a3fbd1 win32: move platform specifics to osdep
This will probably disable this code for Cygwin. I don't know if this
matters, since Cygwin should strictly behave like a Unix anyway.
2015-05-02 18:59:58 +02:00
wm4 1e7831070f build: move main-fn files to osdep
And split the Cocoa and Unix cases. Simplify the Cocoa case slightly by
calling mpv_main directly, instead of passing a function pointer. Also
add a comment explaining why Cocoa needs a special case at all.
2015-05-02 18:59:58 +02:00
wm4 19a5b20752 cocoa: always compile OSX application code with cocoa
This unbreaks compiling command line player and libmpv at the same
time. The problem was that doing so silently disabled the OSX
application thing - but the command line player can not use the
vo_opengl Cocoa backend without it.

The OSX application code is basically dead in libmpv, but it's not
that much code anyway.

If you want a mpv binary that does not create an OSX application
singleton (and creates a menu etc.), you must disable cocoa
completely, as cocoa can't be used anyway in this case.
2015-05-02 18:09:56 +02:00
wm4 d8e92322fa player: handle hotplug events in idle mode too 2015-05-02 18:09:30 +02:00
wm4 15d8cf7fa2 screenshots: create screenshot dir
Minor user convenience.
2015-05-02 16:38:38 +02:00
wm4 f509a2badb vo_opengl: gl_lcms: create cache dir
Minor user convenience.
2015-05-02 16:36:31 +02:00
wm4 dce941b99c vo_opengl: gl_lcms: make sure win32 unicode fopen() wrapper is enabled 2015-05-02 16:35:53 +02:00
wm4 aeea250ab3 vo_opengl: gl_lcms: minor simplification 2015-05-02 16:34:52 +02:00
wm4 ff1b5432e7 vo_opengl: gl_lcms: use mp_path_join()
Maybe this fixes the win32 problems a user had, or maybe not.

Also, check if cache_dir is set at all. An empty string should be
equivalent to "unset".
2015-05-02 16:29:30 +02:00
wm4 a52a494fe4 path: update path descriptions 2015-05-02 16:14:51 +02:00
wm4 dd2c65429f path: fix user path resolution
Forgot to add the remainder to the path.
2015-05-01 22:33:56 +02:00
wm4 fd7bf9c07a manpage: fix typo 2015-05-01 22:17:09 +02:00
wm4 b32a2bf364 osxbundle: remove unnecessary config file entry
This is done via pseudo-gui now.
2015-05-01 21:58:17 +02:00
Niklas Haas 01b793f117 vo_opengl: gl_lcms: make ICC loading less verbose
Especially with the new ICC cache rework, you get a lot of ugly output
messages that don't really contain any meaningful content.
2015-05-01 21:52:08 +02:00
Niklas Haas 1153f13bee vo_opengl: gl_lcms: replace icc-cache by icc-cache-dir
This now stores caches for multiple ICC profiles, potentially all the
user has ever used. The big use case for this is for users with multiple
monitors. The old logic would mandate recomputing the LUT and discarding
the cache whenever dragging mpv from one screen to another.

This also avoids having to save and check the ICC profile itself, since
the file name already uniquely determines it.
2015-05-01 21:52:08 +02:00
Niklas Haas 47d46ec487 vo_opengl: attach target-prim/target-csp to window screenshots
This will essentially make screenshot-tag-colorspace also affect the
"screenshot window" command, where possible.

Unfortunately, it's completely incompatible with icc-profile, due to API
limitations of ffmpeg (we can only give it an enum of well-known
primaries, rather than an actual ICC profile or primaries).
2015-05-01 21:52:07 +02:00
wm4 756991bd4f screenshots: change default directory in pseudo-gui mode to desktop
This should take care of the endless complaints about the default
location for screenshots (and will of course create new ones).

If the screenshot-template is set to an absolute path, the directory
won't be used. So this should be reasonably compatible.
2015-05-01 21:51:10 +02:00
wm4 72373bb5ae screenshots: prefix default template with "mpv-"
So that the user realizes where they come from, or can find them at all.
This was a common complaint, and this is the most lazy solution. Better
suggestions for a default template are welcome.
2015-05-01 21:51:10 +02:00
wm4 8192500716 path: add resolving desktop path to platform-specific paths
win32 has a special function for this.

I'm not sure about OSX - it seems ~/Desktop can be hardcoded, and the
OSX GUI actually localizes the _displayed_ path in its UI.

For Unix, there is not much to be done, or is there.
2015-05-01 21:51:10 +02:00
wm4 7381db60e2 path: expose platform-specific path resolvers 2015-05-01 21:51:10 +02:00
wm4 6814830b9a timer: add "static" to a variable 2015-05-01 21:51:10 +02:00
wm4 d3a3cfe54c path: refactor
Somewhat less ifdeffery, higher flexibility. Now there are 3 separate
config file resolvers for 3 platforms (unix, win, osx), and they can
still interact with each other somewhat. For example, OSX for now uses
most of Unix, but adds the OSX bundle path.

This can be extended to resolve very specific platform paths, such as
location of the desktop.

Most of the Unix specific code moves to path-unix.c.

The behavior should be the same - if not, it is likely a bug.
2015-05-01 21:51:10 +02:00
wm4 60958ddf9b screenshots: add --screenshot-directory option
The plan is to use this to change the screenshot default location in
pseudo-gui mode.
2015-05-01 21:51:09 +02:00
wm4 94a3a76ee3 vo_rpi: update renderer size on display size changes too
(Not sure why it worked without this when I tested the previous
changes.)

Untested, but should be fine. This is equivalent what is done on e.g.
panscan changes.
2015-05-01 19:22:35 +02:00
wm4 e185887ba0 video/out: remove VOFLAG_FLIPPING
I think this used to be quite important, because the ancient VfW support
in MPlayer used to output flipped frames. This code has been dead in mpv
for quite some time (because VfW decoders were removed, and the --flip
option was dropped too), so get rid of it.
2015-05-01 18:47:27 +02:00
wm4 0a7abbda6b vo_opengl: refactor wayland frame skipping
Currently, the wayland backend needs extra work to avoid drawing more
often than the wayland frame callback allows. (This is not ideal, but
will be fixed at a later time.)

Unify this with the start_frame callback added for cocoa. Some details
change for the better. For example, if a frame is dropped, and a redraw
is done afterwards, the actually correct frame is redrawn, instead
whatever was in the textures from before the dropped frame.
2015-05-01 18:44:45 +02:00
wm4 e23e4c7c60 cocoa: don't accidentally drop initial screen drawing
With --idle --force-window, or when started from the bundle, the cocoa
code dropped the first frame. This resulted in a black frame on start
sometimes.

The reason was that the live resizing/redrawing code was invoked, which
simply set skip_swap_buffer to false, blocking redrawing whatever was
going to be rendered next. Normally this is done so that the following
works:

1. vo_opengl draw a frame, releases GL lock
2. live resizing kicks in, redraw the frame
3. vo_opengl wants to call SwapBuffers, drawing a stale buffer
   overwritten by the live resizing code

This is solved by setting skip_swap_buffer in 2., and querying it in 3.

Fix this by resetting the skip_swap_buffer at a known good point: when
vo_opengl starts drawing a new frame.

The start_frame function returns bool, so that it can be merged with
is_active in a following commit.
2015-05-01 18:26:58 +02:00
Avi Halachmi (:avih) ffcad1a72b vo: improve frame drop logic on high playback rate
Commit f1746741de changed the drop
logic to have more slack (drop more frames but less frequent) to prevent
drops due to timing jitter when the clip and screen have similar rates.

However, if the clip has higher rate than the screen (or just higher
playback rate), then that policy hurts smoothness since these "chunked
drops" look worse than one frame drop at a time.

This patch restores the old drop logic when the playback frame rate is
higher than ~5% above the screen refresh rate, and solves this issue.

Fixes #1897
2015-05-01 19:11:44 +03:00
wm4 d01228058b player: properly destroy client context if thread can't be created
Minor leak in an obscure out of memory case.
2015-04-30 21:57:08 +02:00
wm4 8c7f3adb41 vo_rpi: update display size on display mode switches 2015-04-30 21:56:16 +02:00
wm4 6ae66e717f vo_rpi: actually draw a black background
Also factor the display size initialization into a separate function.

For some reason this seems to work, although setting the background
color using this 1x1 pixel bitmap does not work. I blame the RPI
beign a terrible piece of hardware with even worse drivers.
2015-04-30 21:56:13 +02:00
wm4 382434d45a ao_coreaudio_exclusive: check format explicitly on change notifcation
This should for now be equivalent; it's merely more explicit and will
be required if we add PCM support.

Note that the property listeners actually tell you what property
exactly changed, but resolving the current listener mess would be too
hard. So check for changes manually.
2015-04-29 23:10:45 +02:00
wm4 34a5229b23 ao_coreaudio_utils: log mp format with CoreAudio format description
As a consequence, it also logs whether mpv can a this format at all.
2015-04-29 23:07:36 +02:00
wm4 32b835c03b ao_coreaudio_utils: add function for ASBD -> mp format lookup
Useful with some of the following commits.

ca_fill_asbd() should behave exactly as before.

Instead of actually implementing the inverse function of ca_fill_asbd(),
just loop over the (small) list of mpv functions and check if any mpv
equivalent to a given ASBD exists.
2015-04-29 23:06:10 +02:00
wm4 3295ce48ab ao_coreaudio_utils: float is not a signed integer format
kAudioFormatFlagIsSignedInteger implicates that it's only used with
integer formats. The mpv internal flag on the other hand signals the
presence of a sign, and this is set on float formats.

Until now, this probably worked fine, because at least AudioUnit is
ignoring the uncorrect flag.
2015-04-29 22:39:28 +02:00
Niklas Haas 99439f11ea
csputils: improve contrast semantics for limited range output
The previous version of this logic resulted in black crush and incorrect
brightness scaling when combined with limited range (TV) output.
2015-04-29 22:09:09 +02:00