Commit Graph

44190 Commits

Author SHA1 Message Date
pavelxdd 98a257b3a8 angle_dynamic: silence warnings during compilation
If Angle is statically linked there were some warnings during compilation.

Fixes #3834
2016-11-25 09:49:49 +01:00
wm4 c03a67c37c audio/out/push: play silence on --audio-stream-silence
Until now, this was only implemented for ao_alsa and AOs not using
push.c. ao_alsa.c relied on enabling funny underrun semantics for
avoiding resets on lower levels, while other AOs using push.c didn't do
anything.

Change this and at least make push.c copy silent data to the AO. This
still isn't perfect as keeping track of how much silence was played when
seems complex, so we don't do it. The consequence is that frame-stepping
will essentially randomize the A/V offset (it'll recover immediately
when unpausing, but still ugly). Also, in order to empty the currently
buffered audio on seeks etc., we still call ao_driver->reset and so on,
so the AO driver will still need to handle this specially.

The intent is to make behavior with ALSA less weird (for one we can
remove the code in ao_alsa.c that tries to trigger an initial
underflow). Also might help with #3754.
2016-11-24 20:52:15 +01:00
Philip Langdale 48a7c4be3a vo_opengl: hwdec_cuda: Prefix cuda symbols to avoid collisions
We want to avoid causing problems if libmpv is used in an application
that links cuda, or if the libav* libraries are linked with cuda,
as might happen if the scale_npp filter is used.
2016-11-24 20:15:57 +01:00
wm4 5aab17f833 vo_opengl: hwdec_cuda: make some init errors verbose
Improves autoprobe behavior. This is equivalent to other hwdec interop
wrappers. If CUDA is just not available, it should remain silent.
2016-11-24 18:14:55 +01:00
pavelxdd e89382f5f6 vo_opengl: hwdec_cuda: fix crash when trying to use hwdec=cuda if cuda SDK is not present
If CUDA SDK wasn't installed, mpv crashed immediately with the message "Failed to load CUDA symbols"
2016-11-24 14:42:30 +01:00
Philip Langdale 7eacaf51f8 vo_opengl/cuda_dynamic: Use explicit cast to silence warnings on windows
Fixes #3834
2016-11-24 11:40:52 +01:00
Philip Langdale 3abb6f1fef wscript: Fix cuda test to actually work when cuda SDK is not present
The test ended up failing if cuda.h wasn't present, even if cuda.h
isn't used during the actual build.

This test is attempting to establish if the ffmpeg being built
against has dynlink_cuda support. While it might theoretically be
possible to build against the older normally-linked-cuda version
of ffmpeg, it seems more trouble than it's worth.
2016-11-23 20:48:26 +01:00
wm4 755e9fad29 command: warn against deprecated properties in all cases
For some reason, some types of accesses didn't warn, for example when
using mp.observe_property() in Lua. This was because the deprecation
handling code explicitly checks certain accesses. I'm not quite certain
why it was done this way. Just make it warn always.

This could be backported to the current release, if we cared.
2016-11-23 17:30:46 +01:00
wm4 f696975fe3 angle_dynamic: minor simplification
Remove the inverted condition by swapping if branches.
2016-11-23 16:02:28 +01:00
wm4 79d99bd264 demux_mkv: distinguish mp2 and mp3
demux_mkv.c has returned mp3 for mp2 since the initial commit. Normally
not a problem.
2016-11-23 15:57:35 +01:00
Martin Herkt f9668f5596
Support linking ANGLE 2016-11-23 04:09:16 +01:00
Martin Herkt 535e180b9e
DOCS/compile-windows: be more specific about the D3D compiler DLL
Also provide a more useful link to _43 and _47.
2016-11-23 01:23:12 +01:00
wm4 6b3d682f4e vo_opengl: hwdec_d3d11egl: fix ANGLE fallback define
This was a typo in the extensiuon spec and was probably always broken.
Could have led to broken builds when used with ancient ANGLE headers
(or possibly generic EGL headers).
2016-11-23 01:09:19 +01:00
Philip Langdale f5e82d5ed3 vo_opengl: hwdec_cuda: Use dynamic loading for cuda functions
This change applies the pattern used in ffmpeg to dynamically load
cuda, to avoid requiring the CUDA SDK at build time.
2016-11-23 01:07:26 +01:00
Ricardo Constantino ebd9ce9fca
osc: fix use of deprecated idle property
Fixes regression since 7201fd7d
2016-11-22 21:00:04 +00:00
Philip Langdale 585c5c34f1 vo_opengl: hwdec_cuda: Support P016 output surfaces
The latest 375.xx nvidia drivers add support for P016 output
surfaces. In combination with an ffmpeg change to return those
surfaces, we can display them.

The bulk of the work is related to knowing which format you're
dealing with at the right time. Once you know, it's straight forward.
2016-11-22 20:19:58 +01:00
wm4 5087816a74 options: remove legacy global sub-option syntax
A bit of sanity, although a very small one.

--vo sub-options are not affected by this yet.
2016-11-22 15:55:13 +01:00
wm4 7201fd7d08 command: redefine some deprecated properties
As threatened by the API changes document.

We can actually keep the deprecated --playlist-pos and --cache options,
since they are aliases and not used by the corresponding properties.
They are inconsistent, but do no harm. Keep them for now for the sake of
the command line user.

mpv_identify.sh partially stopped working, because it was never updated.
The shell magic can't deal with property names that contain "/", so we
can't replace "samplerate" with "audio-params/samplerate" - just remove
these properties. (How about you use ffprobe?)
2016-11-22 15:54:45 +01:00
wm4 78f76bdddd tv: fix option type
It appears this makes it actually compatible with the property. It was
an ancient MPlayer artifact all along.
2016-11-22 15:54:45 +01:00
wm4 c731513efa wscript: fix typo 2016-11-22 15:54:44 +01:00
wm4 07b6969ba4 vf_vdpaurb: remove this filter
Was deprecated, superseded by --hwdec=vdpau-copy.
2016-11-22 15:54:44 +01:00
wm4 f30c5d09f4 client API: turn mpv_suspend() and mpv_resume() into stubs
As threatened by the API changes document.

This commit also removes or stubs equivalent calls in IPC and Lua
scripting.

The stubs are left to maintain ABI compatibility. The semantics of the
API functions have been close enough to doing nothing that this probably
won't even break existing API users. Probably.
2016-11-22 15:54:44 +01:00
James Ross-Gowan 745862131f d3d11va: unconditionally load D3D DLLs
At least with Nvidia drivers, some thread tries to access D3D11 objects
after ANGLE unloads d3d11.dll. Fix this by holding a reference to
d3d11.dll ourselves.

Might fix the crash in #3348. (I wish I knew why though.)
2016-11-23 01:18:44 +11:00
wm4 f843ae9983 Fix some future release version numbers
Since the recent release was named 0.22.0 instead of 0.21.1, bump all
mentions of 0.22.0 to 0.23.0. These were planned removals of deprecated
versions, which obviously didn't happen in 0.22.0.
2016-11-21 20:17:41 +01:00
wm4 de37c5b1cb audio: fix --audio-stream-silence with ao_wasapi
Seems like wasapi will restart the HDMI stream if resume is called
during playback.
2016-11-21 19:35:06 +01:00
wm4 fcba41e2e4 audio: fix --audio-stream-silence with ao_alsa
ao_alsa.c calls this before the common code sets ao->sstride.

Other than this, I'm still not sure whether this works. Seems like no,
or depends.
2016-11-21 19:35:06 +01:00
Ricardo Constantino b39a7fddb5
osc: fix possible race condition in right timecode 2016-11-21 18:20:53 +00:00
Martin Herkt eafc273d2c
DOCS: update interface changes 2016-11-20 18:14:41 +01:00
wm4 bb48f09532 options: clarify --softvol deprecation message and manpage entry
People seem to think that the softvol behavior is deprecated, but what
is deprecated is actually disabling softvol.
2016-11-19 01:19:14 +01:00
wm4 5a011c5c06 player: removing last playlist entry while looping should not stop
Run "playlist-remove current" while the last playlist entry is being
played stopped playback. Fix this and return to the first entry instead.

Fixes #3808.
2016-11-18 13:46:34 +01:00
wm4 c4d6fcbb02 player: make sure non-video subtitle rendering is reset if video resumes
If video reaches EOF, subtitle timing will be switched to timing without
video frames. This means it calls osd_set_force_video_pts() and
overrides the PTS of whatever video frame is current (since the video
frame's PTS has nothing to do with the current playback position
anymore).

This was not reset when seeking back into video. Subtitles wouldn't show
up, or if there was a subtitle displayed, it would get stuck with it. In
particular, this could happen even if EOF was only temporary (such as
with --keep-open).

Fix this by clearing the override PTS whenever a video frame is shown.

Fixes #3770.
2016-11-18 13:02:03 +01:00
Stefano Pigozzi 6250007bca travis: fix ffmpeg-git build 2016-11-17 15:07:54 +01:00
James Ross-Gowan 803e2c5f87 win32: fix some Clang warnings
- win32-console-wrapper.c was inconsistently using the explicit Unicode
  versions of some Windows API functions and structures.
- vo.c should use llabs for int64_t, since long is 32-bit on Windows.
- vo_direct3d.c had a potential use of an uninitialized variable if it
  took the first goto error_exit.
2016-11-17 23:34:20 +11:00
James Ross-Gowan 40b626fd9b build: fix compilation with mingw-w64/Clang
This fixes the build in mingw-w64/Clang on MSYS2. It also disables the
use of gnu_printf in Clang, which was what was causing most of the
warnings. The Clang-compiled mpv binary appears to work, but there are
no guarantees yet, since until now mpv has only been tested with
mingw-w64/GCC on Windows.

Fixes #3800
2016-11-17 23:34:20 +11:00
Ricardo Constantino a3c27786c6
wscript: move install dirs setting to after C compiler check
This fixes waf setting the wrong LIBDIR for DEST_OS=win32 in
waflib/Tools/c_config.py:get_cc_version()

Any scripts assuming the implib and pkgconfig are in the wrong
place should be changed to move the .dll instead.
2016-11-16 17:29:22 +00:00
Ricardo Constantino 03ea61c895
ytdl_hook: sort chapters by time
mpv doesn't work well with unordered chapters.
ex: https://youtu.be/DIKPUL6b4N8
2016-11-15 22:58:43 +00:00
wm4 274c6f36f5 DOCS/client-api-changes.rst: fix typo 2016-11-15 23:49:36 +01:00
wm4 79efe248a5 DOCS/interface-changes.rst: reword a line
Try to make it sound a bit less weird. Probably still sounds weird,
so feel free to propose further changes.
2016-11-15 23:47:06 +01:00
wm4 106f607ef7 README: add links to various changelogs
We're too lazy to maintain a full changelog, but there are still a bunch
of places which document specific changes. A user really should check
them on each update, even if there are transition periods (including
printing warnings etc.) for most changes. It's a good idea to give them
more exposure by adding them to the README.
2016-11-15 23:42:33 +01:00
wm4 c1ae1def85 ao_alsa: explicitly add default device manually
The "default" entry (which is and always was mpv/mplayer's default) does
not have a description set in the ALSA API. (While "sysdefault"
strangely has.)

Instead of an empty description, this should show something nice, so
reuse the ao.c code for naming default devices (see previous commit).

It's still a bit ugly that audio-device-list will have a default entry
for "Autoselect device" and "Default (alsa)", but then again we probably
want to allow the user to force ALSA (i.e. prevent fallbacks to other
AOs) just because ALSA is so flaky and makes this a legitimate feature.
2016-11-14 13:42:49 +01:00
wm4 a2b93e0c27 audio: make empty device ID mean default device
This will make it easier for AOs to add explicit default device entries.
(See next commit.)

Hopefully this change doesn't lead accidentally to bogus "Default"
entries to appear, but then it can only happen if the device ID is
empty, which would mean the underlying audio API returned bogus entries.
2016-11-14 13:42:41 +01:00
wm4 84513ba58b audio: avoid returning audio-device-list entries without description
Use the device name as fallback. This is ugly, but still better than
skipping the description entirely. This can be an issue on ALSA, where
the API can return entries without proper description.
2016-11-14 13:33:53 +01:00
Philip Sequeira cf85191cb7 vo_opengl: blend against background color for --alpha=blend
Do it after color management, etc. so that it matches the color drawn in
the margins.
2016-11-13 18:21:27 +01:00
Stefano Pigozzi 19c9347e47 docs: remove trailing spaces
Some slipped in with previous commit.
2016-11-11 21:44:27 +01:00
Akemi aceeeaf9bb cocoa: option to scale window by HiDPI scale factor
Deactivating this options makes it possible to
circumvent the default OS X behavior of using
points. Windows on HiDPI resolutions won't open
in double the size anymore and videos are display
in their native resolution when windowed.

Fixes #3716
2016-11-11 21:37:04 +01:00
wm4 98e7b4e538 av_common: always make sure to return a valid timebase
av_reduce(&num, &den, 1, 14112000, 1000000) can return num=0, den=1.
This means a 1/14112000 timebase (as used by the mp3 demuxer) would
become invalid.

The intention of mp_get_codec_timebase() is to always return a valid
timebase. av_reduce() probably does the logically correct thing - so add
a fallback to the safe default timebase.

Also, increase the av_reduce() parameter to INT_MAX. Let's just pray
this doesn't cause any actual problems. libavformat does the same, but
might be in a different position due to using av_rescale() etc., while
we convert between fractional timestamps and floats.
2016-11-10 12:06:17 +01:00
wm4 ca175871cd vdpau: fix hwdec uninit
This is a bit unintuitiv, but it appears hwdec backends have to unset
hwdec_priv manually in their uninit function. Normally with this idiom
you'd expect the common code to do this (and maybe even freeing the priv
struct). Since other hwdec backends do this quite consistently, just fix
vdpau for now.

Also add an assert to detect similar bugs sooner.

Fixes #3788.
2016-11-10 08:39:09 +01:00
wm4 fc1017c335 dec_video: don't spam missing PTS warnings
Only print at most 2. Just because with some decoders, we will always
hit this code path, such as playing avi of vfw-muxed mkv on RPI.
2016-11-09 17:51:19 +01:00
wm4 67467103e8 dec_video, dec_audio: avoid full reinit on switches to the same segment
Same deal as with the previous commit.

(Unfortunately, this code is still duplicated.)
2016-11-09 16:44:06 +01:00
wm4 a55e8ff31c dec_sub: avoid full reinit on switches to the same segment
The previous commit means subtitles were reinitialized on every seek
(even within a segment). This commit restores the old behavior.

To check whether the segment changed at all, we don't reset the current
start/end values. This assumes the decoder wrapper is always fed by a
stream which doesn't mix segment and non-segment packets, which is
currently always true.
2016-11-09 16:44:06 +01:00