Commit Graph

45873 Commits

Author SHA1 Message Date
wm4 3c62a20f48 manpage: clarify --sub-file(s) options
This was a bit confused, and I bet nobody understood whether to use
--sub-file or --sub-files, and what the difference is. Explicitly
mention that both variants exist, and how they are related.
2017-12-07 23:48:16 -08:00
wm4 80d43ee4e6 player: when loading external file, always add all track types
Until now, using --sub-file would add only subtitle tracks from the
given file. (E.g. if you passed a video file, only the subtitle tracks
from it were added, not the video or audio tracks.)

This is slightly messy (because streams are hidden), and users don't
even want it, as shown by #5132. Change it to always add all streams.
But if there's no stream of the wanted type, we still report an error
and do not add any streams. It's also made sure none of the other track
types are autoselected.

Also adjust the error messages on load failure slightly.

Fixes #5132.
2017-12-07 23:48:16 -08:00
wm4 520fc74036 player: rebase start time even for subtitle streams
It appears libavformat never sets the file start time for subtitles, so
this special check is not needed. The original idea was probably that
_if_ the demuxer set the start time to the first subtitle packet, the
subtitles would be shifted incorrectly.
2017-12-07 23:48:16 -08:00
Drew DeVault 8977fe5ed9 Use /dev/tty instead of stdin for terminal input
Fixes #4190

This allows you to use terminal input even if you've piped something
into mpv.
2017-12-08 01:30:42 +02:00
pavelxdd 665173d8b2 w32_common: improve the window message state machine
* Distinguish between the window being moved or not.
* Skip trying to snap if currently in full screen or an embedded
  window.
* Exit snapped state if the size changed when the window was being
  moved.
2017-12-07 23:32:56 +02:00
pavelxdd 483437ba91 w32_common: skip window snapping if Windows handled it
Check the expected width and height against up-to-date
window placement. If they do not match, we will consider snapping
to have happened on Windows' side.
2017-12-07 23:32:56 +02:00
Kevin Mitchell 985e83e217 Revert "ytdl: handle HLS with FFmpeg"
Apparently, this breaks youtube live and possibly other things.

This reverts commit 06519aae58.
2017-12-07 00:46:27 -08:00
wm4 06519aae58 ytdl: handle HLS with FFmpeg
Using youtube-dl's metadata ends up with stupid things like missing
variant streams, or missing audio streams entirely.
2017-12-06 23:59:59 -08:00
Aman Gupta 0c6a488ef9 options: add --start=none to reset previously set start time
Previously when using a libmpv instance to play multiple videos,
once --start was set there was no clear way to unset it. You could
use --start=0, but 0 does not always mean the beginning of the file
(especially when using --rebase-start-time=no). Looking up the start
timestamp and passing that in also does not always work, particularly
when the first timestamp is negative (since negative values to --start
have a special meaning).

This commit adds a new "none" value which maps to the internal
REL_TIME_NONE, matching the default value of the play_start option.
2017-12-06 20:50:31 +02:00
Leo Izen a2e34b6f41 manpage: minor fixes to documenation 2017-12-06 00:11:37 -08:00
Kevin Mitchell f23c21ef17 manpage: add note about properties not immediately showing up
fixes #5134
2017-12-06 09:05:57 +02:00
Leo Izen 0433162f7f player/osd.c: fix putting --start time on OSD
I missed an ab-loop check in ff7e294. It should now work as expected.
2017-12-05 17:15:08 -05:00
Leo Izen 9513165c99 player/playloop.c: fix --loop-file without --start
I missed a check for MP_NOPTS_VALUE in 4efe330. Now
it should work as expected.
2017-12-05 14:36:47 -05:00
Rostislav Pehlivanov f19797dea6 Remove support for ffmpeg-mpv 2017-12-05 08:27:55 +00:00
Rostislav Pehlivanov a743fef837 vo: add support for externally driven renderloop and make wayland use it
Fixes display-sync (though if you change virtual desktops you'll need to seek
to re-enable display-sync) partially under wayland.

As an advantage, rendering is completely disabled if you change desktops or
alt+tab so you lose no performance if you leave mpv running elsewhere as long
as it isn't visible.

This could also be ported to other VOs which supports it.
2017-12-05 08:26:24 +00:00
Leo Izen 713668b99a manpage: add some minor documenation fixes
- replace the incorrect reference to --opengl-shader
- document a caveat when using --image-display-duration
- add some documentation on --vf=lavfi=
2017-12-04 20:57:16 -05:00
wm4 7a3df7d6a4 Copyright: remove removed file from GPL list 2017-12-05 01:19:53 +01:00
Leo Izen fdc311625e player/misc.c: allow both --length and --end to control play endpoint
Most options that change the playback endpoint coexist and playback
stops when it reaches any of them. (e.g. --ab-loop-b, --end, or
--chapter). This patch extends that behavior to --length so it isn't
automatically trumped by --end if both are present. These two will
interact now as the other options do.

This change is also documented in DOCS/man/options.rst.
2017-12-04 12:34:02 -05:00
James Ross-Gowan 9abb710afb vo_gpu: d3d11_helpers: use better formatting for PCI IDs
The old format was definitely misleading, since it used an 0x prefix and
formatted the device IDs with %d.
2017-12-04 20:11:20 +11:00
Leo Izen 4efe330efb player/playloop.c: respect playback start time when using --loop-file
Using --loop-file should now seek to the position denoted by --start
or equivalent option, rather than always seeking to the beginning as
it had done before. --loop-playlist already behaves this way, so
this brings --loop-file in line for added consistency.
2017-12-03 22:32:36 -05:00
Leo Izen ff7e294610 player: use start timestamp for ab-looping if --ab-loop-a is absent
If --ab-loop-b is present, then ab-looping will be enabled and will
attempt to seek to the beginning of the file. This patch changes it
so it will instead seek to the start of playback, either via --start
or some equivalent, rather than always to the beginning of the file.
2017-12-03 22:23:24 -05:00
Leo Izen a6ca167794 player: add get_play_start_pts
Added a get_play_start_pts function to coincide with the
already-existing get_play_end_pts. This prevents code duplication
and also serves to make it so code that probes the start time
(such as get_current_pos_ratio) will work correctly with chapters.

Included is a bug fix for misc.c/rel_time_to_abs that makes it work
correctly with chapters when --rebase-start-time=no is set.
2017-12-03 21:57:34 -05:00
Ckat e92d1b72a7 TOOLS/autoload.lua: update extensions
* duplicated 'ogv' renamed to 'ogm'
* 'ogg' and 'opus' added as common audio file extensions
2017-12-03 22:12:53 +01:00
sfan5 3ac8a7f694 stream_libarchive: Fix locale includes on macOS
Fixes #5108
2017-12-03 21:54:12 +01:00
Nicolas F 744b67d9e5 Fix various typos in log messages 2017-12-03 21:24:18 +01:00
Mariusz Skoneczko 1a9fb7937a manpage: vaapi-copy is not limited to Intel GPUs
vaapi-copy works with some AMD cards
2017-12-03 21:19:39 +01:00
Anton Kindestam cc16cd5aa4 video: probe format of primary plane in drm/egl context
We need to support hardware/drivers which do not support ARGB8888 in
their primary plane.

We also use p->primary_plane_format when creating the gbm surface, to
make sure it always matches (in actuality there should be little
difference).
2017-12-03 17:30:17 +02:00
Anton Kindestam 04e5fbde43 hwdec: whitespace cleanup in hwdec_drmprime_drm.c 2017-12-03 17:30:17 +02:00
Anton Kindestam eb46d46e73 video: fix use of possibly-NULL pointer in drm_egl_init 2017-12-03 17:30:17 +02:00
Anton Kindestam 5129d777a6 video: fix double free in drm_atomic_create_context
Passing in an invalid DRM overlay id with the --drm-overlay option would
cause drmplane to be freed twice: once in the for-loop and once at the
error-handler label fail.

Solve by setting drmpanel to NULL after freeing it.

Also the 'return false' statement after the error handler label should
probably be 'return NULL', given that the return type of
drm_atomic_create_context returns a pointer.
2017-12-03 17:30:17 +02:00
wm4 9bbf8a6dfa travis: remove Libav check for now
I sure hope they merge the patches for the required hwdec info API,
which is already in FFmpeg.
2017-12-02 23:30:11 +01:00
wm4 7bc48f7843 build: remove nanosleep() check
Also guaranteed by POSIX.
2017-12-02 23:29:40 +01:00
wm4 0601e48ef4 build: remove termios check
Also should be fully covered by POSIX.
2017-12-02 23:27:23 +01:00
wm4 d7a02bcb3b build: remove POSIX/sysv shared memory test
vo_x11 and vo_xv need this. According to the Linux manpage, all involved
functions are POSIX-2001 anyway. (I just assumed they were not, because
they're mostly System V UNIX legacy garbage.)
2017-12-02 23:19:13 +01:00
wm4 ca29a5aa9b vd_lavc: don't request native pixfmt with -copy and METHOD_INTERNAL
If the codec uses AV_CODEC_HW_CONFIG_METHOD_INTERNAL, and we're using
the -copy method, then don't request the native pix_fmt. It might not
have a AVFrame.hw_frames_ctx set, and we couldn't read back at all. On
top of that, most of those decoders probably don't provide read-back
when using such opaque formats anyway, while providing separate decoding
modes to decode to RAM.
2017-12-02 21:08:38 +01:00
Martin Herkt 1d92a804d2
man: remove incorrect note about default opengl backend 2017-12-02 06:49:12 +01:00
wm4 292724538c video: remove some more hwdec legacy stuff
Finally get rid of all the HWDEC_* things, and instead rely on the
libavutil equivalents. vdpau still uses a shitty hack, but fuck the
vdpau code.

Remove all the now unneeded remains. The vdpau preemption thing was not
unused anymore; if someone cares this could probably be restored.
2017-12-02 04:53:55 +01:00
wm4 23a9efd124 vd_lavc, vdpau, vaapi: restore emulated API avoidance
This code is for trying to avoid using an emulation layer when using
auto probing, so that we end up using the actual API the drivers
provide. It was destroyed in the recent refactor.
2017-12-02 04:53:51 +01:00
wm4 0780d38329 hwdec: don't require setting legacy hwdec fields
With the recent changes, mpv's internal mechanisms got synced to
libavcodec's once more. Some things are still needed for filters (until
the mechanism gets replaced), but there's no need to require other hwdec
methods to use these fields. So remove them where they are unnecessary.

Also fix some minor leaks in the dxva2 backends, and set the driver_name
field in the Apple ones. Untested on Apple crap.
2017-12-02 04:53:51 +01:00
wm4 8b3dbab19e vd_lavc: simpler way to check for opque hw frame
The ->fmt shit is something I'd like to phase out.
2017-12-02 02:45:49 +01:00
wm4 3c07db0345 vd_lavc: sort -copy hwdec modes to end of list
Otherwise, if e.g. "nvdec" didn't work, but "nvdec-copy" did, it would
never try "vdpau", which is actually the next non-copy mode on the
autprobe list. It's really expected that it selects "vdpau". Fix this by
sorting the -copy modes to the end of the final hwdec list.

But we still don't want preferred -copy modes like "nvdec-copy" to be
sorted after fragile non-preferred modes like "cuda", and --hwdec=auto
should prefer "nvdec-copy" over it, so make sure the copying mode does
not get precedence over preferred vs. non-preferred mode.

Also simplify the existing auto_pos sorting condition, and fix the
fallback sort order (although that doesn't matter too much).
2017-12-02 02:32:41 +01:00
wm4 b279cfb1dd vd_lavc: allow forcing single implementations with --hwdec 2017-12-02 00:57:25 +01:00
wm4 5990f640f4 vd_lavc: slightly simplify
Factor the somewhat-duplicated code into an append function. Also fix
setting the copying flag in one of the cases. This also ensures some
uniformity.
2017-12-02 00:54:42 +01:00
wm4 47f7920006 vd_lavc: coding style 2017-12-02 00:45:03 +01:00
wm4 627fa5aae0 hwdec: remove unused HWDEC_* constants
Removing the rest requires replacing some other mechanisms, later.
2017-12-01 22:09:38 +01:00
wm4 55c7e96878 vd_lavc: fix dumb nonsense 2017-12-01 22:08:59 +01:00
wm4 9d367cb0f9 vd_lavc, mp_image: remove weird mpv specific palette constant
Was for times when we were trying to be less dependent on libav* I
guess.
2017-12-01 22:03:38 +01:00
wm4 d891239d72 vd_lavc: merge redundant header
This is not needed anymore.
2017-12-01 22:01:54 +01:00
wm4 076b1d266e audio: fix missing volume update on init and reinit
This is never updated after the AO inits, so there are several cases
where the volume would stay at 100%, even if it shouldn't. This affects
initial volume as well as track switching or switching between files.
2017-12-01 21:18:06 +01:00
Nicolas F 2e24f5f1b5 scripting: report dlerror() output
dlopen() and dlsym() can fail in various ways, and we can find out
how it failed by calling dlerror(). This is particularly useful if
you typo the filename of a script when explicitly passing it with
--script, and dlopen actually tells you that the file doesn't exist
instead of leading you down a rabbit hole of disassembling your
shared object file to figure out why the thing won't load.
2017-12-01 21:13:48 +01:00