Commit Graph

46869 Commits

Author SHA1 Message Date
zc62 de2b1920f3 demux: support cue sheets longer than 100 minutes
Remove the 2-digit-number restriction when reading the number of
minutes in the cue sheet INDEX command.

Fixes #6481
2019-04-01 23:39:08 +02:00
Aman Gupta 9c22bd4898 player: show restart position
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-04-01 23:38:38 +02:00
Leo Izen fcb320fd3f DOCS/man/mpv.rst: Fix big-cache profile example
The cache options were changed, and this commit
fixes the example big-cache profile to use the
new cache options.
2019-03-16 21:17:56 +01:00
Philip Sequeira 98eea65605 x11: fix cursor hiding initial state
Regression from 8e3308d687.

Broken cases were:
* --no-cursor-autohide acted like --cursor-autohide=always.
* --cursor-autohide-fs-only always hid the cursor if starting
  non-fullscreen; entering fullscreen at least once fixed it.
2019-03-16 21:17:32 +01:00
Bin Jin dd83b66652 vo_gpu: increase user shader size limit
The old size limit was chosen before LUT texture was supported in user
shader. At that time, the whole user shader will be compiled and run
on GPU, which makes large user shader impractical to be used.

With the introduction of LUT texture, the old size limit doesn't make
any sense. For example, a 1024x1024 rgba16f LUT will cost 32MB shader
size.

Fix this by increasing the size limit to a value that's unlikely be
reached.
2019-03-13 21:47:24 +02:00
Akemi 92e9b6da71 build: fix adding of object files to linking with cplugins disabled
this was meant to be fixed by 546f038, but with --disable-cplugins the
do_the_symbol_stuff function was never called and the handle_add_object
function was again always called before the actual linking task was
created.

to fix this we explicitly call handle_add_object only after all the
tasks the do_the_symbol_stuff function is called after too.

Fixes #6028
2019-03-13 21:44:43 +02:00
Rodger Combs 4fd3af14cd macosx_events: fix crash when shutting down during window animations 2019-03-13 19:44:34 +01:00
Rodger Combs ec0b5e527b build: enable swift debug information when requested 2019-03-13 19:44:34 +01:00
Avi Halachmi (:avih) d6ca985831 player: fix core activity state check
Adds the negation missed in 8816e1117e
when moving from a positive-is-active to positive-is-idle variable.

This leads to proper updates to properties such as "eof-reached",
as well as fixes screensaver state updates.

Separately found and fixed by avih and wnoun.

Co-authored-by: wnoun <wnoun@outlook.com>
2019-03-12 01:56:32 +02:00
wnoun 94203436c4 vo_libmpv: fix null pointer dereference
Closes: #6507
2019-03-11 01:55:59 +02:00
Jan Ekström 199aabddcc Merge branch 'master' into pr6360
Manual changes done:
  * Merged the interface-changes under the already master'd changes.
  * Moved the hwdec-related option changes to video/decode/vd_lavc.c.
2019-03-11 01:00:27 +02:00
Bin Jin 1d0349d3b5 vo_gpu: add two useful operators to user shader
modulo operator could be used to check if size is multiple of a
certain number.

equal operator could be used to verify if size of different textures
aligns.
2019-03-09 12:56:11 +01:00
Bin Jin b3cbd46509 vo_gpu: make texture offset available to CHROMA hooks
Before this commit, texture offset is set after all source textures
are finalized. Which means CHROMA hooks won't be able to align with
luma planes. This could be problematic for chroma prescalers utilizing
information from luma plane.

Fix this by find the reference texture early, and set global texture
offset early.
2019-03-09 12:56:11 +01:00
zc62 e37c253b92 lcms: allow infinite contrast
Fixes #5980
2019-03-09 12:55:44 +01:00
Philip Sequeira 89eacf8131 demux_edl: don't assume data follows a comment line
There could be another comment line or the end of the file.

Fixes #6529.
2019-03-03 13:13:45 +01:00
zc62 b9cde8d95c sub: recognize UTF-8 characters in SDH subtitle filter
Only printable ASCII characters were considered to be valid texts. Make
it possible that UTF-8 contents are also considered valid.

This does not make the SDH subtitle filter support non-English
languages. This just prevents the filter from blindly marking lines that
have only UTF-8 characters as empty.

Fixes #6502
2019-03-02 02:05:58 +01:00
Martin Herkt 8f5a42b1a0
options: do not enable WMV3 hwdec by default
Crashes NVIDIA, probably buggy on others. No one ever tests this shit.

See #2192
2019-03-01 12:44:45 +01:00
Gunnar Marten b275232141 demux: fix seek range update after head packets are pruned
The seek range update was to early and did not take the removed head
packets into account. And therefore missed that the queue was not
BOF anymore.
This led to not be able to backward seek before the first packet of
the first seek range.

Fix it by moving the seek range update after the possible removal and
the change of the BOF flag.

Fixes: #6522
2019-03-01 00:55:06 +02:00
zc62 d38c4879d7 player: do not rebase start time for subtitle streams
As stated in the original commit message, if the demuxer set the start
time to the first subtitle packet, the subtitles would be shifted
incorrectly. It appears that it is the case for external PGS subtitles.

This reverts commit 520fc74036.

Fixes #5485
2019-02-28 23:23:47 +01:00
Anton Kindestam 537006965e context_drm_egl: implement n-buffering
This allows context_drm_egl to use as many buffers as libgbm or the
swapchain_depth setting allows (whichever is smaller).

On pause and on still images (cover art etc.) to make sure that output does not
lag behind user input, the swapchain is drained and reverts to working in a dual
buffered (equivalent to swapchain-depth=1) manner.

When possible (swapchain-depth>=2), the wait on the page flip event is now not
done immediately after queueing, but is deferred to the next invocation of
swap_buffers. Which should give us more CPU time between invocations.

Although, since gbm_surface_has_free_buffers() can only tell us a boolean value
and not how many buffers we have left, we are forced to do this contortionist
dance where we first overshoot until gbm_surface_has_free_buffers() reports 0,
followed by immediately waiting so we can free a buffer, to be able to get the
deferred wait on page flip rolling.

With this commit we do not rely on the default vsync fences/latency emulation of
video/out/opengl/context.c, but supply our own, since the places we create and
wait for the fences needs to be somewhat different for best performance.

Minor fixes:

 * According to GBM documentation all BO:s gotten with
   gbm_surface_lock_front_buffer must be released before gbm_surface_destroy is
   called on the surface.
 * We let the page flip handler function handle the waiting_for_flip flag.
2019-02-25 01:25:25 +01:00
Anton Kindestam ae115bd8d8 opengl: Support GL_ARB_sync style fences on OpenGL ES 3.0
OpenGL ES 3.0 and up has suppport for for GL_ARB_sync style fences.
Make sure that mpv can use them.
2019-02-25 01:25:25 +01:00
zc62 a127912345 audio: fix segfault caused by incorrect number of planes
Use `mp_aframe_get_planes` to properly get the number of planes, instead
of assuming it to be the number of channels.

Fixes #6092
2019-02-23 00:21:54 +02:00
Niklas Haas 8b563a0346 vo_gpu: fix initial seeding of the peak detect ssbo
This solves some edge cases when using files with very weird metadata
(e.g. MaxCLL 10k and so forth). Instead of just blindly seeding it with
the tagged metadata, forcibly set the initial state from the detected
values.
2019-02-18 01:54:06 +02:00
Niklas Haas 3f1bc25d4d vo_gpu: use dB units for scene change detection
Rather than the linear cd/m^2 units, these (relative) logarithmic units
lend themselves much better to actually detecting scene changes,
especially since the scene averaging was changed to also work
logarithmically.
2019-02-18 01:54:06 +02:00
Niklas Haas b4b719e337 vo_gpu: clamp sigmoid function
Can explode on some clips otherwise
2019-02-18 01:54:06 +02:00
Niklas Haas 258ed5d471 vo_gpu: tone map before gamut mapping
Gamut mapping can take very bright out-of-gamut colors into the
negatives, which completely destroys the color balance (which tone
mapping tries its best to preserve).
2019-02-18 01:54:06 +02:00
Niklas Haas 677ae4f8fe vo_gpu: make --gamut-warning warn on negative colors
As is the case for actually out-of-gamut colors (rather than just too
bright colors).
2019-02-18 01:54:06 +02:00
Niklas Haas 11b58415d5 vo_gpu: improve numerical accuracy of PQ OETF constant
Not a huge deal, but we can do the division in C, which makes the float
constant larger.
2019-02-18 01:54:06 +02:00
Niklas Haas 4e8022da26 vo_gpu: allow color management in dumb mode
There's no point to disallow target-trc/prim in dumb mode, since they
still work fine.
2019-02-18 01:54:06 +02:00
Niklas Haas fdd671188d vo_gpu: improve accuracy of HDR brightness estimation
This change switches to a logarithmic mean to estimate the average
signal brightness. This handles dark scenes with isolated highlights
much more faithfully than the linear mean did, since the log of the
signal roughly corresponds to the perceptual brightness.
2019-02-18 01:54:06 +02:00
Niklas Haas 12e58ff8a6 vo_gpu: allow boosting dark scenes when tone mapping
In theory our "eye adaptation" algorithm works in both ways, both
darkening bright scenes and brightening dark scenes. But I've always
just prevented the latter with a hard clamp, since I wanted to avoid
blowing up dark scenes into looking funny (and full of noise).

But allowing a tiny bit of over-exposure might be a good thing. I won't
change the default just yet (better let users test), but a moderate
value of 1.2 might be better than the current 1.0 limit. Needs testing
especially on dark scenes.
2019-02-18 01:54:06 +02:00
Niklas Haas 6179dcbb79 vo_gpu: redesign peak detection algorithm
The previous approach of using an FIR with tunable hard threshold for
scene changes had several problems:

- the FIR involved annoying hard-coded buffer sizes, high VRAM usage,
  and the FIR sum was prone to numerical overflow which limited the
  number of frames we could average over. We also totally redesign the
  scene change detection.

- the hard scene change detection was prone to both false positives and
  false negatives, each with their own (annoying) issues.

Scrap this entirely and switch to a dual approach of using a simple
single-pole IIR low pass filter to smooth out noise, while using a
softer scene change curve (with tunable low and high thresholds), based
on `smoothstep`. The IIR filter is extremely simple in its
implementation and has an arbitrarily user-tunable cutoff frequency,
while the smoothstep-based scene change curve provides a good, tunable
tradeoff between adaptation speed and stability - without exhibiting
either of the traditional issues associated with the hard cutoff.

Another way to think about the new options is that the "low threshold"
provides a margin of error within which we don't care about small
fluctuations in the scene (which will therefore be smoothed out by the
IIR filter).
2019-02-18 01:54:06 +02:00
Niklas Haas 3fe882d4ae vo_gpu: improve tone mapping desaturation
Instead of desaturating towards luma, we desaturate towards the
per-channel tone mapped version. This essentially proves a smooth
roll-off towards the "hollywood"-style (non-chromatic) tone mapping
algorithm, which works better for bright content, while continuing to
use the "linear" style (chromatic) tone mapping algorithm for primarily
in-gamut content.

We also split up the desaturation algorithm into strength and exponent,
which allows users to use less aggressive desaturation settings without
affecting the overall curve.
2019-02-18 01:54:06 +02:00
Emmanuel Gil Peyrot 36600ff163 wayland_common: rename “shell” into “wm_base”
This is the naming xdg-shell stable adopted, it doesn’t make much sense
to keep using “shell” everywhere with all functions calling it
“wm_base”.

Finishes what 76211609e3 started.
2019-02-17 23:44:34 +02:00
Martin Herkt 3dd59dbed0
options: do not enable MPEG2 hwdec by default
Too many broken hardware decoders. Noticed wrong decoding of a video
file encoded with x262 on RX Vega when using VAAPI (Mesa 18.3.2).
Looks fine with swdec and a cheap hardware BD player.

Reverts 017f3d0674
2019-02-13 02:43:57 +01:00
Akemi 777a863bb6 cocoa-cb: remove empty elements from dropped URLs
Fixes #6241
2019-02-10 23:47:34 +02:00
Akemi 6ce570359a cocoa-cb: add support for VOCTRL_GET_DISPLAY_NAMES 2019-02-10 22:39:25 +02:00
Akemi ace61c120f cocoa-cb: use Swift Extensions for convenience
preparations for the following commit.
2019-02-10 22:39:25 +02:00
Ken f2e7e81bda mac: add missing semicolon to macosx_compat.h
fixes build on older systems
2019-01-26 20:44:36 +01:00
Aman Gupta 9284543ab9 wscript_build: de-duplicate build file list 2019-01-25 21:24:36 +02:00
Akemi a4298b1a69 cocoa-cb: fix side by side Split View again
some safety mechanism for the async fs animation aren't needed anymore,
due to possible improved logic and slightly different behaviour on new
macOS versions. that safety fallback prevented the Split View because
it always returned a rectangle of the whole screen, instead of just
part/half of it.

Fixes #6443
2019-01-23 09:32:02 +01:00
Kotori Itsuka 94d35627f5 DOCS/options.rst: update target-peak description
List auto as an option for target-peak, and state that auto is its
default operation.
2019-01-23 09:31:35 +01:00
Kotori Itsuka 05f0980b96 vo_gpu: allow resetting target-peak to the trc default
Add "auto" the possible values of target-peak.  The default value
for target_peak is to calculate the target using mp_trc_nom_peak.
Unfortunately, this default was outside the acceptable range of
10-10000 nits, which prevented its later reassignment.  So add an
"auto" choice to target-peak which lets clients and scripts go back
to using the trc default after assigning a value.
2019-01-23 09:31:35 +01:00
Akemi 08679f756c vd_lavc: increase the possible length of the hwdec name
this lead to an unexpected videotoolbox-copy hwdec name due to the last
two chars being cut off. since selection is also done by that name one
had to use "videotoolbox-co" to explicitly use the copy mode of
videotoolbox.
2019-01-23 09:30:58 +01:00
Julian 73fe0611b3 stats: merge multiple properties into one line
Merge file-size/file-format and audio channel-count/format into one line
respectively. This fixes stats overflowing the screen in larger than
19:6 aspect ratios. In this case a problem was reported for ~21:9 which
should be common enough for us to "support" it.
2019-01-16 16:59:00 +01:00
Olivier Perret 9be68e49b2 lua: execute idle handlers after timers have been processed
Idle handlers used to not be executed when timers were active
Now they are executed:
* After all expired timers have been executed
* After all events have been processed (same as when there are no timers)
2019-01-16 16:58:46 +01:00
Benjamin Barenblat c681fc133c DOCS/man: update man pages to describe ReplayGain fallback
Describe ReplayGain album-to-track fallback behavior introduced in
commits e392d6610d and
be90f2c8dd.
2019-01-16 16:58:33 +01:00
Benjamin Barenblat 585f9ff42f demux: make ALBUM ReplayGain tags optional when using libavformat
Commit e392d6610d modified the native
demuxer to use track gain as a fallback for album gain if the latter is
not present. This commit makes functionally equivalent changes in the
libavformat demuxer.
2019-01-16 16:58:33 +01:00
Dan Oscarsson aab595f828 command: notify on multiply
doing multiply on a property is also a set property command
and the change should be notified so others can observe the change
2019-01-16 16:58:15 +01:00
Oliver Freyermuth d6d6da4711 stream_dvb: Correct range for dvbin-card option.
Adapt documentation accordingly and
also, fix an off-by-one check in the code.
closes #6371
2018-12-12 01:50:43 +02:00