Commit Graph

45915 Commits

Author SHA1 Message Date
TheAMM 3c4667c862 js: implement mp.msg.trace()
To match the new Lua helper introduced in
1afdeee1ad

Add documentation for both.
2017-12-16 02:25:24 -08:00
Niklas Haas 1afdeee1ad lua: implement mp.msg.trace 2017-12-15 22:28:47 -08:00
Niklas Haas d64c33c518 msg: bump up log level of --log-file
This now logs -v -v by default, instead of -v.
2017-12-15 22:28:47 -08:00
Niklas Haas ba1943ac00 msg: reinterpret a bunch of message levels
I've decided that MP_TRACE means “noisy spam per frame”, whereas
MP_DBG just means “more verbose debugging messages than MSGL_V”.
Basically, MSGL_DBG shouldn't create spam per frame like it currently
does, and MSGL_V should make sense to the end-user and provide mostly
additional informational output.

MP_DBG is basically what I want to make the new default for --log-file,
so the cut-off point for MP_DBG is if we probably want to know if for
debugging purposes but the user most likely doesn't care about on the
terminal.

Also, the debug callbacks for libass and ffmpeg got bumped in their
verbosity levels slightly, because being external components they're a
bit less relevant to mpv debugging, and a bit too over-eager in what
they consider to be relevant information.

I exclusively used the "try it on my machine and remove messages from
MSGL_* until it does what I want it to" approach of refactoring, so
YMMV.
2017-12-15 22:28:47 -08:00
Larivact d744dca537 README: some rewording and markdown improvements 2017-12-15 22:16:59 -08:00
Larivact 732c33e884 README: reorganize table of contents
Add missing sections, make order consistent, create a new section for external
links and rename "Manual" link.
2017-12-15 22:16:55 -08:00
pavelxdd e1ac0c1eb6 options: rename 'error' labels to 'exit' where appropriate 2017-12-16 02:20:44 +03:00
pavelxdd 7fc9ff54d3 options: don't report errors on help value for OPT_SIZE_BOX
The same idea as in 3723e61 but for OPT_SIZE_BOX now.

Affects options `autofit`, `autofit-larger` and `autofit-smaller`.
2017-12-16 01:29:05 +03:00
Martin Shirokov 0e311fc0e8 ipc: avoid dereferencing NULL
This can happen when ctr->client_api->shutting_down is set to true,
or when there are over 1000 clients with the same name passed to mp_new_client().
2017-12-15 12:51:16 +02:00
wm4 cedcdc1f3c vd_lavc: rename --hwdec=rpi to --hwdec=mmal
Annoying exception that makes no sense to keep. Normally, users or
client applications will either use --hwdec=auto, or not set the option
at all, which both leads to the expected result.
2017-12-15 12:32:25 +02:00
wm4 9824a30eb1 vd_lavc: use libavcodec metadata for hardware decoder wrappers
This removes the need to keep an explicit list and to attempt to parse
codec names. Needs latest FFmpeg git.
2017-12-15 12:32:25 +02:00
Vittorio Giovara d7d670fcbf csputils: Add support for Display P3 primaries 2017-12-14 23:31:09 +02:00
Vittorio Giovara 3b0ed13e39 csputils: Fix DCI P3 primaries white point 2017-12-14 23:31:09 +02:00
pavelxdd 74c6e7ba1d subprocess-win: don't change the mouse cursor in CreateProcess
By default the CreateProcess changes the mouse cursor to
IDC_APPSTARTING. The new flag added to STARTUPINFOEXW prevents
changing the cursor from default arrow on creating a new process.
2017-12-14 21:35:55 +11:00
TSaaristo 522bfe5be1 lua+js: implement utils.file_info()
This commit introduces mp.utils.file_info() for querying information
on file paths, implemented for both Lua and Javascript.

The function takes a file path as an argument and returns a Lua table /
JS object upon success. The table/object will contain the values:
mode, size, atime, mtime, ctime and the convenience booleans is_file, is_dir.

On error, the Lua side will return `nil, error` and the Javascript side
will return `undefined` (and mark the last error).

This feature utilizes the already existing cross-platform `mp_stat()`
function.
2017-12-13 21:55:28 +02:00
Leo Izen 47131365a3 sd_ass: accept otc as fallback OpenType collection file extension
The OpenType Font File specification recommends that "Collection fonts
that use CFF or CFF2 outlines should have an .OTC extension." mpv
should accept .otc as a fallback extension for font detection should
the mimetype detection fail.
2017-12-13 21:00:22 +02:00
Leo Izen f3d2f4c6c2 sd_ass: accept RFC8081 font media types
IETF RFC8081 added the "font" top-level media type,
including font/ttf, font/otf, font/sfnt, and also
font/collection. These font formats are all supported
by mpv/libass but they are not accepted as valid
Matroska mime types. mpv can load them via file extension
and they work as expected, so files using the new types
should not trigger a warning from mpv.
2017-12-13 21:00:22 +02:00
wm4 26cdd52801 vf_buffer: remove this filter
It has been deprecated for a while and is 100% useless. It was forgotten
in the recent filter purge. Get rid of it.
2017-12-12 22:02:56 +02:00
pavelxdd 6c8e7daebb options: don't report errors on help value for OPT_GEOMETRY
The same idea as in 3723e61 but for OPT_GEOMETRY now.
2017-12-11 21:56:20 +02:00
pavelxdd cdb6cb55e0 options: don't report errors on help value for OPT_COLOR
The same idea as in 3723e61 but for OPT_COLOR now.
Added missing closing bracket in the help message.
2017-12-11 21:56:20 +02:00
pavelxdd 3f127448e8 options: don't report errors on help value for OPT_FLAG
The same idea as in 3723e61 but for OPT_FLAG now.
2017-12-11 21:56:20 +02:00
pavelxdd 6a85f9bf74 w32_common: update outdated comment about wakeup events
mpv doesn't use WM_USER for wakeup events since 91079c0
Updated the comment.
2017-12-11 11:51:41 -08:00
wm4 308b3cd71b vf_convert: default to limited range when converting RGB to YUV
Full range YUV causes problems everywhere. For example it's usually the
wrong choice when using encoding mode, and libswscale sometimes messes
up when converting to full range too. (In this partricular case, we
found that converting rgba->yuv420p16 full range actually seems to
output limited range.)

This actually restores a similar heueristic from the late vf_scale.c.
2017-12-11 21:27:11 +02:00
wm4 5e38e03980 vo_gpu: hwdec_drmprime_drm: silence error on failed autoprobing
When autoprobing the hwdec interops (which now happens to all compiled
interops if hardware decoding is used), failure to load an interop
should not print an error in the normal case. So hide it.

(We could make the log level conditional on whether autoprobing is used,
but directly loading it without autoprobing is obscure, and most other
interops don't do this either.)
2017-12-11 20:50:50 +02:00
wm4 92c4be4b6e hwdec: document a forgotten parameter
Add the "all" value to the --gpu-hwdec-interop help output.
2017-12-11 20:44:59 +02:00
wm4 6047333f0b video: remove code duplication by calling a hwdec loader helper
Make gl_video_load_hwdecs() call gl_video_load_hwdecs_all() when
all HW decoders should be loaded.
2017-12-11 20:44:59 +02:00
wm4 5196c34aec video: properly initialize and set hwdec_interop
Don't reset --gpu-hwdec-interop if vo_gpu uses dumb mode.
2017-12-11 20:44:59 +02:00
wm4 a4705e8b59 vd_lavc: always load VO interops with non-copy hw decoders
For METHOD_INTERNAL hwdecs (non-copy cases), make sure the VO interops
are always loaded, because those decoders will output hardware pixel
formats, which will need special support in vo_gpu. Otherwise,
initialization will fail, complaining that it can't convert the output
format to something the VO supports.
2017-12-11 20:44:59 +02:00
pavelxdd fd4e756e9c osd: fix a compiler warning by adding parentheses in if condition 2017-12-10 17:20:58 -08:00
Jan Ekström affcccb007 vo: fix a compiler warning by properly printing a 64bit integer 2017-12-11 00:16:01 +02:00
LongChair b60ac5b5ba vd_lavc: add rkmpp to the hwdec_wrappers array.
Allows to get the hwdec picked up properly by mpv on rockchip devices
2017-12-10 18:24:50 +02:00
wm4 b782c90180 demux_timeline: disable pointless packet cache for sub-demuxers
It seems like there's nothing stopping from sub-demuxers from keeping
packets in the cache, even if it's completely pointless. The top-most
demuxer (demux_timeline) already takes care of caching, so sub-demuxers
only waste space and time with this.

Add a function that can disable the packet cache even at runtime and
after packets are read. (It's not clear whether it really can happen
that packets are read before demux_timeline gets the sub-demuxers, but
there's no reason to make it too fragile.) Call it on all sub-demuxers.

For this to work, it seems we have to move the code for setting the
seekable_cache flag to before demux_timeline is potentially initialized,
because otherwise the cache would be reenabled if the demuxer triggering
timeline support is a timeline segment itself (e.g. ordered chapters).
2017-12-10 06:37:49 +02:00
wm4 451a502c1d demux: fix accounting for seekable ranges on track switches
This fixes missing audio when cycling through audio tracks with anything
that uses nested demuxers, such as demux_timeline, which us used for
EDL, --merge-files, ordered chapters, and youtube-dl pseudo DASH
support. When this bug happened, reenabling an audio track would lead to
silence for the duration of the readahead amount.

The underlying reason is the incorrectly updated buffered range on track
switch. It accidentally included the amount covered by the deselected
stream. But the cause of the observed effect was that demux_timeline
issued a refresh seek to the underlying slave demuxer, which in turn
thought it could do a cache seek, because the seek range still included
everything.

update_stream_selection_state() calls update_seek_ranges() to update the
seek ranges after a track switch. When reenabling the track, ds->eager
was set to false during update_seek_ranges(), which made it think the
stream was sparse, and thus it didn't restrict the current seek range
(making later code think everything was buffered). Fix this by moving
some code, so we first update the ds->eager flag, then the seek ranges.

Also verbose log the low level stream selection calls.
2017-12-10 06:37:49 +02:00
Anna-Maria Meriniemi 39bc954488 manpage: Fix typo (reomve -> remove)
This commit fixes the "reomve" typo in the Javascript docs.
2017-12-10 00:10:02 +02:00
Drew DeVault f60bfd1ad5 terminal-unix: fix race condition with tty reset
Calling do_deactivate_getch2 before joining the terminal thread could
lead to breakage if the terminal thread got another interation in before
it was signaled to stop.

This also addresses a minor error with the order in which things are
initialized - getch2_poll would previously call tcgetpgrp(tty_in) before
tty_in was initialized, which did not lead to broken behavior, but was
not correct either.

Fixes #5195
2017-12-09 21:37:44 +02:00
Drew DeVault a0fc195112 terminal-unix: switch back to poll(3)
This leverages the new polldev shim which lets us "poll" device files on
macOS with select and use the genuine article on other platforms.
2017-12-09 21:11:46 +02:00
Drew DeVault ba418132cd osdep: add poll shim for macOS
This implements a poll-compatible interface, backed by select on macOS,
suitable for polling on device files - which are not supported by
macOS's implementation of poll. This is a (long-standing) bug in macOS,
so hopefully we can eventually remove this shim.
2017-12-09 21:11:46 +02:00
James Ross-Gowan 1d7a746505 appveyor: fix FFmpeg download
Broken in f19797dea6. It seems like the Git server on git.ffmpeg.org
doesn't like clone --depth=1, so use the GitHub mirror instead.
2017-12-09 20:01:54 +11:00
James Ross-Gowan 6ab7e0d465 vo_gpu: d3d11: check for timestamp query support
Apparently timestamp queries are optional for 10level9 devices. Check
for support when creating the device rather than spamming error messages
during rendering. CreateQuery can be used to check for support by
passing NULL as the final parameter.

See:
https://msdn.microsoft.com/en-us/library/windows/desktop/ff476150.aspx#ID3D11Device_CreateQuery
2017-12-09 19:53:53 +11:00
pavelxdd 3723e611fc options: don't report errors on help value for OPT_CHOICE
'help' is a valid value for a lot of mpv options, such as `hwdec`
or `vo` for printing available values, so this change makes the
output of OPT_CHOICE options like `--video-sync=help` more
consistent by not reporting an error about invalid value 'help'.
2017-12-08 20:47:14 +02:00
wm4 0a749a38f7 video: add a shitty hack to avoid missing subtitles with vf_sub
update_subtitles() makes sure all subtitle packets at/before the given
PTS have been read and processed. Normally, this function is only called
before sending a frame to the VO. This is too late for vf_sub, which
expects the subtitles to be updated before feeding a frame to the
filters.

Apparently this was specifically a problem for the first frame.
Subsequent frames might have been ok due to general prefetching.

(This will fail anyway, should a filter dare to add an offset to the
timestamps of the filered frames before they pass to vf_sub.)

Fixes #5194.
2017-12-08 20:33:23 +02:00
Drew DeVault 0f9a690eba terminal-unix: fix busy looping on Linux
POSIX permits select() to modify the timeout, which can happen on the
Linux implementation. This can reset the timeout, which spins this into
a tight loop. A timeout isn't necessary in the first place, so just use
NULL instead.
2017-12-08 19:58:36 +02:00
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