Commit Graph

44178 Commits

Author SHA1 Message Date
Kevin Mitchell 387f501278 audio: make setting audio-exclusive update the audio chain
This is required since exclusive mode requires entirely different
initializaiton.
2016-10-04 12:48:26 -07:00
wm4 39f515cb6a audio/out: prevent underruns with spdif under certain conditions
The player tries to avoid splitting frames with spdif (sample alignment
stuff). This can in certain corner cases with certain drivers lead to
the situation that ao_get_space() returns a number higher than 0 and
lower than the audio frame size. The playloop will round this down to 0
bytes and do nothing, leading to a missed wakeup. This can lead to
underruns or playback completely getting stuck.

It can be reproduced by playing AC3 passthrough with no video and:

    --ao=null --ao-null-buffer=0.256 --ao-null-outburst=6100

This commit attempts to fix it by allowing the playloop to write some
additional data (to get a complete frame), that will be buffered within
the AO ringbuffer even if the audio device doesn't want it.
2016-10-04 19:31:17 +02:00
wm4 13dcf82a96 manpage: fix closing quote 2016-10-04 16:52:36 +02:00
wm4 202f14aa29 vo_opengl: hwdec_rpi: fix NULL pointer deref in certain cases
If a client API user provides the MPGetNativeDisplay callback, but
returns NULL for "MPV_RPI_WINDOW", this would crash.
2016-10-04 16:36:20 +02:00
wm4 75cab315ea command: include deprecated/aliased options in property bridge
If we really want client API users to use mpv_set_property() instead of
mpv_set_option(), then compatibility handling of deprecated options
should be included. Otherwise, there's the danger that client API users
either break too early (and without a warning), or mpv_set_option() will
continue to have a reason to exist.
2016-10-04 13:23:11 +02:00
rr- ba3f6f3779 vo_drm: fix tiny memory leak 2016-10-04 13:23:11 +02:00
rr- 1648ff8a0f vo_drm: refactor getting display fps
Reduces code duplication between OpenGL backend and DRM VO.

(The control() for OpenGL backend isn't sufficiently similar to the
VO's control() to consider merging it as a whole - I extracted only the
FPS code.)
2016-10-04 13:23:11 +02:00
wm4 abbc8fc84a player: fix previous commit
...
2016-10-03 17:16:02 +02:00
Dan Oscarsson 7debdde9b9 options: rename subtitle options
Rename the text subtitle options from --sub-text- to --sub-
and --ass- options to --sub-ass-.
The intention is to common sub options to prefixed --sub-
and special ASS option be seen as a special version of sub options.
The OSD options that work like the --sub- options are still named
--osd-.
Man page updated including a short note about renamed --sub-text-*
and --ass-* options to --sub-* and --sub-ass-*.
2016-10-03 16:57:04 +02:00
wm4 81d125efd8 DOCS/interface-changes.rst: mention seek command change
This is potentially incompatible if a program used negative timestamps
to deal with timestamp resets, which would potentially lead to mpv
producing and using negative timestamps.
2016-10-03 15:49:53 +02:00
Philip Sequeira ff531b71e3 command: allow absolute seeks relative to end of stream
"seek -10 absolute" will seek to 10 seconds before the end. This more or less
matches the --start option and negative seeks were otherwise useless (they just
clipped to 0).
2016-10-02 18:01:52 +02:00
wm4 3a5cbf3907 audio: fix late audio start
Regression since commit bbcd0b6a. This code is just cursed, because it's
a fragile state machine with no proper tests, and which could be done in
a much simpler way. Without doubt this change will cause a regression in
some ridiculous corner case as well.

Fixes #3610 (the cause of it, not the behavior it resulted in).
2016-10-02 13:47:25 +02:00
wm4 6f4d918cb7 audio: dump timestamp difference
Can help to analyze timestamp jitter or seeing completely bogus
timestamps.
2016-10-02 12:55:22 +02:00
Bernhard Frauendienst 8d29d5b5d7 vaapi: support drm devices when running in vaapi-copy mode
When the vaapi decoder is used in copy mode, it creates a dummy
display to render to. In theory, this should support hardware
decoding on on a separate GPU that is not actually connected to
any output (like an iGPU which supports more formats than the
external GPU to which the monitor is connected).

However, before this change, only X11 displays were supported as
dummy displays. This caused some graphics drivers (namely
intel-driver) to core dump when they were not actually used as X11
module.
This change introduces support for drm libav displays, which
allows vaapi-copy to run on such cards which are not actually
rendering the X11 output.
2016-10-02 12:38:33 +02:00
wm4 39fc5e1deb player: make --stop-screensaver runtime-changeable
Move the screensaver enable/disable determination to a central place,
and call it if the stop-screensaver property is changed.

Also, do not stop the screensaver when in idle mode (i.e. no file is
loaded).

Fixes #3615.
2016-10-02 12:33:34 +02:00
wm4 e3a57272a7 stream_libarchive: add some more points at which reading can be stopped 2016-10-01 18:19:57 +02:00
wm4 486b3ce6f8 vo_opengl: minor simplification
The extra gl_transform_trans() has no apparent use.
2016-10-01 16:12:03 +02:00
wm4 82231fd74d vo_opengl: attempt to fix chroma offset under rotation and flipping
Other than being overly convoluted, this seems to make sense to me.
Except that to get the "rot" transform I have to set flip=true, which
makes no sense at all to me.
2016-10-01 16:07:51 +02:00
wm4 052584c9e2 vo_opengl: add debugging options for testing with padded textures 2016-10-01 12:09:18 +02:00
wm4 52fea2f909 vo_opengl: partially fix dumb-mode cropping with rotation
Combining rotation and cropping didn't work. It was just completely
broken.

I'm still not sure if this is correct. Chroma positioning seems to be
broken on rotation. There might also be a problem with non-mod-2 frame
sizes. Still, strictly an improvement for both rotated and non-rotated
rendering modes.

Also, this could probably be written in a more elegant way.
2016-09-30 22:19:01 +02:00
wm4 026cccaddf csputils: add note that mp_invert_cmat() is LGPL too
Commit aa1047a3 originally added this as:

+    // this is from the DarkPlaces engine, reduces to 3x3. Original code
+    // released under GPL2 or any later version.

According to Rudolf Polzer, the original author (a certain LH) was
actually asked whether it would be ok to put this code under LGPL, and
the author gave his agreement. This code is not from id Software either
(on which large parts of DarkPlaces is based on), which is the main
reason why DarkPlaces is under GPL.

So this note is just confusing, and always has been LGPL. Fix it.
2016-09-30 17:08:24 +02:00
wm4 ea50f6fdef msg: flush after every message for --log-file
We'd like to get log messages on the output as soon as possible in the
output. I also feel like using fflush() is nicer than using setvbuf().
Who knows how the latter behaves on win32.
2016-09-30 14:55:59 +02:00
wm4 33c24b07e4 vo_opengl: vaegl: log more debugging infos 2016-09-30 14:36:42 +02:00
wm4 5f547e57e3 vo_opengl: rpi: remove dumb comment
It's not even true anymore.
2016-09-30 14:28:55 +02:00
wm4 51f10c512e vo_opengl: rpi: fix glaring memory leak
This was in previously inactive code (uploading yuv420p), so it did not
matter.
2016-09-30 13:53:12 +02:00
wm4 ab07caf39d vo_opengl: rpi: use overlay for yuv420p too
The video code can deal fine with feeding software image formats to
hwdec interop drivers. In RPI's case, this is preferable for
performance, working around OpenGL bugs (see RPI firmware issue #666),
and because OpenGL rendering doesn't bring too many advantages due to
RPI supporting GLES 2.0 only.

Maybe a way to force the normal video path is needed later. But
currently, this can be tested by just not loading the hwdec interop
driver.

If you run command-line mpv and set --hwdec to something that does
not load the RPI interop layer, you'll even have to use --hwdec-preload
manually to get it enabled.
2016-09-30 13:49:49 +02:00
wm4 2aba6972cf vo_opengl: allow hwdec interops to support multiple image formats 2016-09-30 13:46:27 +02:00
wm4 2f1af04745 vo_opengl: egl: print EGL errors only if not probing
Avoids printing an error when trying to create a GLES 3.x context on a
device which can do GLES 2.0 only.
2016-09-30 13:06:31 +02:00
wm4 d3111ee777 vo_opengl: rpi: raise the video layer
Was intended to put the GL layer above the standard console. (But
actually that was done already, and the oddness I'm seeing seems to
be an unrelated bug.)
2016-09-30 13:05:58 +02:00
wm4 1d385b0dae vd_lavc: log if hw decoding selects a different underlying decoder
Less confusing to see what's going on. I think there were more than one
users who got tricked by this, including myself.
2016-09-30 13:05:39 +02:00
wm4 7e6456f43a rpi: add --hwdec=rpi-copy
This means it can be used with normal video filters.

Might help out with #3604.
2016-09-30 13:05:30 +02:00
wm4 b6920372c2 ipc: log when listening to IPC socket
Fixes #3598.
2016-09-29 16:47:19 +02:00
wm4 86ab4b8a9f path: default ~~ paths to home directory
The code for expanding the ~~ prefix used mp_find_config_file(), which
strictly looks for _existing_ files in any config path (e.g. not just
the user-local one, but also system-wide config). If no such file
exists, it simply returns NULL, which makes the code below just return
the literal, unexpanded path.

Change this so that it'll resolve the path to the user-local config
directory instead.

Requested in #3591.
2016-09-29 16:44:01 +02:00
wm4 b81ae52f50 player: enable reading from stdin after loading input.conf
Someone requested this.
2016-09-29 16:26:54 +02:00
wm4 c245d04c37 mp_image: fix clearing to black with p010 format
Using vf_expand (which uses mp_image_clear()) with p010 cleared chroma
to green instead.
2016-09-29 16:12:58 +02:00
James Ross-Gowan f549cec0ac w32_common: implement VOCTRL_GET_DISPLAY_NAMES
This should make display-names usable on Windows. It returns a list of
GDI monitor names like "\\.\DISPLAY1". Since it may be useful to get the
monitor that Windows considers associated with the window (with
MonitorFromWindow,) this will always be returned as the first argument.
This monitor is the one used for display-fps and icc-profile-auto.
2016-09-29 23:49:36 +10:00
Ricardo Constantino 6487ba4864 ytdl_hook: Set aspect ratio for anamorphic video 2016-09-28 21:16:40 +02:00
Philip Langdale 1557ca6712 cuda: initialize hwframes format
In retrospect, this seems obvious, but ffmpeg didn't complain until
a recent update.
2016-09-28 21:10:15 +02:00
wm4 b344da22ae client API: "priority" option is now runtime settable
So it doesn't have to be in the list of options that can be set before
mpv_initialize() only.
2016-09-28 15:26:24 +02:00
wm4 ef2bbd5a7a msg: make --log-file and --dump-stats accept config path expansion
Seems like a valid use-case. Not sure if I like it calling back into the
config code. Care has to be taken for not letting the config path
resolving code dead-lock (which is why locking details in the msg.c code
are changed).

Fixes #3591.
2016-09-28 15:04:38 +02:00
wm4 73a5bde518 img_format: remove some unneeded format definitions
They're still supported, just that they have no IMGFMT_ alias.
2016-09-28 14:21:32 +02:00
James Ross-Gowan b712095d89 win32: make --priority runtime-settable
I'm not sure if this option affects anything or if it's a placebo,
especially since the VO thread is now registered with MMCSS. Still, I
think --priority=high may have helped back when I used mplayer2 on a
netbook. It's also possible that encoding-mode users would want to set
--priority=idle.

Anyway, it was one of the last M_OPT_FIXED options, so fix that.
2016-09-28 21:47:30 +10:00
James Ross-Gowan 3751065f97 win32: build with -DINITGUID
We always want to use __declspec(selectany) to declare GUIDs, but
manually including <initguid.h> in every file that used GUIDs was
error-prone. Since all <initguid.h> does is define INITGUID and include
<guiddef.h>, we can remove all references to <initguid.h> and just
compile with -DINITGUID to get the same effect.

Also, this partially reverts 622bcb0 by re-adding libuuid.a to the
build, since apparently some GUIDs (such as GUID_NULL) are not declared
in the source file, even when INITGUID is set.
2016-09-28 21:38:52 +10:00
wm4 c239b7de7e vo_opengl: deprecate 'drm-egl' backend and introduce 'drm' instead
Just a name change. Requested.
2016-09-27 16:29:22 +02:00
wm4 45c97aea78 stream_lavf: check seekable flag correctly
AVIOContext.seekable is actually a bitfield. Currently, it has only
AVIO_SEEKABLE_NORMAL defined, but it might be extended with a hint for
non-byte seekability. Thus we should check it correctly.
2016-09-27 15:51:34 +02:00
wm4 b6cbf74518 command: fix inverted condition in sub-reload command
Fixes #3586 (probably). Untested.
2016-09-26 20:12:59 +02:00
rr- 0fe3e9ca5e vo_drm: provide display fps 2016-09-26 19:26:31 +02:00
Akemi 9f30cd8292 cocoa: fix fullscreen regression on 10.11 and newer
Fixes #3364.
2016-09-26 19:25:50 +02:00
Ricardo Constantino f0ab9f05f1 player: allow opts in pseudo-gui set by the user to override user's default
This should still allow user-set default options to override built-in
pseudo-gui while respecting user-set pseudo-gui options.

Pros:
- user option in default profile overrides built-in pseudo-gui's options
  Ex: screenshot-directory overrides built-in pseudo-gui's
- user can "fix" pseudo-gui if some option like "force-window=no" is set
  in default by setting "force-window=yes" in [pseudo-gui]
- `mpv --profile=pseudo-gui` will work as before

Cons:
- --show-profile=pseudo-gui won't display the built-in's options

Original idea from wm4.

Documentation edits mostly by wm4.

Signed-off-by: wm4 <wm4@nowhere>
2016-09-26 19:25:14 +02:00
wm4 dd339b200b video: trust demuxer framerate on invalid timestamps
If the PTS goes backwards (whether it's a timestamp reset or some other
problem) would just use 0 as frame duration. (At least until the logic
for detecting divergence with the timestamps gets active.)

Trust the demuxer framerate in these cases instead, if it's available. I
think this improves behavior slightly with some broken files.
2016-09-26 17:55:00 +02:00