Commit Graph

46320 Commits

Author SHA1 Message Date
Akemi 12b90e744d build: fix swift build with waf 1.8.4
with older waf versions a node doesn't return an absolute path but just
a relative one. fix this by explicitly requesting an absolute one.

Fixes #5604
2018-03-11 22:44:26 -07:00
Akemi 047eb1b914 cocoa-cb: remove unneeded icc-profile-auto check
with the new libmpv API it's not necessary to check for this property
anymore since libmpv will only use the provided profile when it is
needed.
2018-03-11 22:44:26 -07:00
Akemi ef2225c4a2 cocoa-cb: fix usage of wrong fbo when off-screen
when we transitioned to the new libmpv API with commit ae29725 i
reintroduced an old bug that was fixed with 7f714c6 because of a dumb
rebasing error on my part. the branch i based the libmpv changed on was
originally without the fbo fix and on rebasing i forgot to change the
variable to the proper one, basically deactivating the fix.
2018-03-11 22:44:26 -07:00
Akemi 4485e205b9 cocoa-cb: don't deactivate mouse events completely with input-cursor=no
mouse events and the tracking area are needed for (un)hiding the new
title bar, which was broken when input-cursor=no was set. no tracking
area was ever created and set which completely deactivated any mouse
events. the specific mouse event functions were already deactivated
proactively and have the needed check. no events are being propagated to
the mpv core when input-cursor=no is set, even with an active tracking
area.
2018-03-11 22:44:26 -07:00
Aman Gupta b0da883b13 doc: fix formatting of video-frame-info properties 2018-03-11 22:13:12 -07:00
Aman Gupta 4961682f1e demux: fix comment typo 2018-03-11 22:13:12 -07:00
Ricardo Constantino 7d0285b5bb
TOOLS/autoload: be more robust with slow directory listings
Overall, just shuffled code around and added a few debugging messages
for future issues.

The issue could be reproduced easily by quickly navigating through the
playlist inside a network mount.

Closes #5618
2018-03-10 12:46:41 +00:00
wm4 c15af6630f vo_vdpau: fix resizing and rotation problems
The s_size() function, whatever it was supposed to do, caused the
surface size to increase indefinitely. Fix by making it always use the
maximum size that was last used, which is less optimal (many surface
recreations when making the window slowly larger), but at least it
works.

The rotation code didn't mark the old surface as invalid when it was
freed, so it could destroy random other surfaces (let's call it dangling
ID).

Also, the required rotation surface size depends on the rotation mode,
so recreate the surfaces on rotation as well.
2018-03-08 17:12:32 -08:00
wm4 2f20168b0b ao_sdl: fix default buffer size
If you set desired.samples to 0, SDL will return a default buffer size
on obtained.samples. This was broken, because ceil_power_of_two(0)
returns 1. Since 0 is usually not considered a power of two, this is
probably correct, but we still want to set desired.samples to 0 in this
case.
2018-03-08 17:12:32 -08:00
wm4 f40e0cb0f2 ao: do not allow actual buffer size of 0
You can use --audio-buffer=0 to minimize the audio buffer size. But if
the AO reports no device buffer size (like e.g. ao_jack does), then the
buffer size is actually 0, and playback can never work properly.

Make it fallback to a size of 1, which is unlikely to work properly, but
you get what you asked for, instead of a freeze.
2018-03-08 17:12:32 -08:00
wm4 5f41fbb6d9 demux: correctly report buffered size as 0 if there are no packets
Since the demuxer cache addition, ds->queue->head can actually be set to
non-NULL, but the decoder can still be at EOF (with no packets to come).
This made it report an unknown buffered size, instead of 0. Fix this by
checking the decoder part of the packet queue instead.

Probably doesn't matter much, but fixes an annoying "???" on the CLI
status line in some situations.
2018-03-08 17:12:32 -08:00
wm4 075aa21797 vd_lavc: slightly better logging about why hwdec is not used
The old message was outdated and also not very precise. Make it all a
bit more elaborate.
2018-03-08 17:12:32 -08:00
wm4 93fb79166b scripting: make a function static 2018-03-08 17:12:32 -08:00
Akemi 8ecd404264 osxbundle: fix bundle creation with python3
there were several problems that had to be fixed because of differences
between python2 to python3:
- subprocess.check_output returned an unicode instead of a string
- filter() returns an iterator instead of a list
- recursion limit was reached

first two were fixed by explicitly converting to the needed type or
using the proper function invocation. third was fixed by changing the
recursive process_libraries function to an iterative one.

Fixes #5600, #3316
2018-03-08 15:41:50 -08:00
tomty89 013a8f75f3 ao_opensles: bump device buffer size to 200ms
While the soft buffer size is already by default 200ms, it is not enough to guarantee dropout-free playback on Bluetooth audio. Bumping the device buffer size to the same value seems to suffice.
2018-03-07 01:40:05 +02:00
tomty89 0a9ab1b076 ao_opensles: remove set_play_state()
Set play state to playing in init() instead. We no longer touch the play state afterwards.
2018-03-07 01:40:05 +02:00
tomty89 ba68e570de ao_opensles: clear buffer queue in reset()
Avoid resume() from causing SL_RESULT_BUFFER_INSUFFICIENT ("Failed to Enqueue: 7" when seek or resume from pause).
2018-03-07 01:40:05 +02:00
LongChair dae88644e6
hwdec_drmprime_drm: Fix a DRM buffer memory leakage
We use triple buffering for this interop and we were only unreffing the
data structures, which doesn't destroy the drm buffers.

This patch allows to make sure that we release the drm buffers on
playback end.
2018-03-05 23:33:45 -08:00
Akemi ca2c5c26d5 cocoa-cb: fix a segfault without video
we activated the rendering loop a bit too early and it was possible that
the first draw function was called before it was actually ready. this
was a remnant from the old init routine and should have been changed.
start the queue on reconfigure instead of preinit.
2018-03-04 19:08:45 -08:00
Akemi 4d281927e5 cocoa-cb: fix wrong aspect ratio on live resize after reconfig resize
on a file change and when the aspect ratio of the window changed, the
first live resize state had a wrong aspect ratio because the new aspect
ratio was only set after the first resize. just set the new content
frame before the resize.
2018-03-04 19:08:45 -08:00
Akemi 8bfeecbc6f cocoa-cb: change handling of window aspect ratio changes
i tried being smart and handle aspect ratio differences manually via
atomic drawing and resizing to aspect fitted frames. there were a few
issues with that. like unexpected visibility of certain System GUI
elements on entering fullscreen or visually dropped frames due to the
atomic drawing. now we rely on system mechanics to keep the proper
aspect ratio of our layer, the recommended way. as a side effect it also
fixes a segfault.

Fixes #5581
2018-03-04 19:08:45 -08:00
Anton Kindestam 33cffdcbac
context_drm_egl: Allow fallback EGLConfig formats
It turns out that Mali drivers are likely broken, and do not return
GBM_FORMAT_ARGB8888 (they return GBM_FORMAT_XRGB8888) when getting
EGL_NATIVE_VISUAL_ID for any EGLConfig, even though the resulting
EGLConfig appears to be capable of alpha.

It could also be potentially useful to allow an ARGB EGLConfig used
with an XRGB framebuffer on some platforms, so we do that. (cf. weston)

Unrelated indentation fix in gbm_format_to_string.
2018-03-04 16:56:06 -08:00
Philip Langdale f0223e1b83 tv: Recognise v4l2 'JPEG' fourcc
Naturally, there's more than one fourcc that indicates an mjpeg
stream.

I have a particular ancient webcam here (Logitech QuickCam Messanger)
that only supports the single 'JPEG' format, but there are other
devices out there which support both 'JPEG' and 'MJPG' with no visible
differences, and others where the streams are slightly different.

Regardless of those details, it remains correct to treat 'JPEG'
the same as 'MJPG' from a stream consumption perspective.
2018-03-04 16:28:24 -08:00
wm4 496b13227b input: minor additions to default key bindings
This adds key bindings for some semi-popular features. It also tries to
cleanup some old bindings. For example w/e for panscan is now changed to
w/W. In all cases, the old bindings are still kept and work, though.

Part of an ongoing attempt to cleanup the default key bindings.
See #973 for some context.
2018-03-04 16:27:49 -08:00
Akemi a76eecdc2c client: remove legacy API that is unused now
this API was introduced in c5e4538 solely for the use with cocoa-cb and
was not public. with the port to the new API in 760d471 it is now unused
and can safely be removed.
2018-03-04 16:26:35 -08:00
Akemi ae2972557f cocoa-cb: use new libmpv API instead of opengl-cb
a new replacement API was introduced with b037121 and the old one was
deprecated. porting cocoa-cb to the new API.
2018-03-04 16:26:35 -08:00
Akemi d7b6ebf643 cocoa-cb: move the GL dummy function to swift
it's possible to get a function pointer through a closure after all in
swift. remove the GL dummy function from the c header and do it in the
swift code instead.
2018-03-04 16:26:35 -08:00
Akemi 42fd7d0bbf cocoa-cb: remove debug remnant (stray print) 2018-03-04 16:26:35 -08:00
Niklas Haas ad3f6d2f97 vo_gpu: don't segfault in libmpv_gl's destroy()
This segfaults when the GPU context has not been fully initialized, such
as would be the case when initialization errors.
2018-03-04 00:17:00 -08:00
Niklas Haas 79f82a2ca4 wscript: also install render API related headers
Omitted from b0371214
2018-03-04 00:17:00 -08:00
wm4 ed73ba8964 player: fix strange behavior on edition switching
After switching, the playback state was not reset, which could leave it
in a strange, pause like state, that could be fixed by e.g. seeking.

This seems to be an older regression - it's even in 0.27.
2018-03-03 02:38:01 +02:00
wm4 f706076dd1 player: don't free root filter while it's still needed
Sometimes, playback needs to be fully uninitialized and reinitialized
without "officially" closing and reopening the playlist entry. This
happens with PT_RELOAD_FILE, which is triggered by edition switching and
also DVD/BD title switching. (Not really sure why it goes through so
much pain for such obscure cases. All it gains is not resetting "local"
options, and not signaling a reload to the client API. Whatever.)

The recent filter change freed filter_root too early without recreating
it, so it crashed on edition switching.

Fixes #5587.
2018-03-03 02:38:01 +02:00
wm4 0200a71e2f demux_lavf: add some hacks for SDP
Just the usual guess-what-opaque-ffmpeg-thing-supports.

See #5550. It looks like we can reduce packet drop by having the cache
enabled automatically.
2018-03-03 02:38:01 +02:00
wm4 8ce5e794fb player: fix track autoselection of external files yet again
If you used --aufio-file=file.mkv, and file.mkv included a video track
marked as default, then the logic in select_default_track() would pick
the video track from file.mkv. This is 100% broken, so fix it.
2018-03-03 02:38:01 +02:00
wm4 70ea586eb5 command: fix whitespace 2018-03-03 02:38:01 +02:00
wm4 775b86212d video: add option to reduce latency by 1 or 2 frames
The playback start logic explicitly waits until the first frame has been
displayed. Usually this will introduce a wait of 1 vsync. For normal
playback this doesn't matter, but with respect to low latency needs,
this only leads to additional data getting queued up in the demuxer or
network buffers.

Another thing is that the timing logic decodes 1 frame ahead (= 1 frame
extra latency) to determine the exact duration of a frame.

To be fair, there doesn't really seem to be a hard reason why this is
needed. With the current code, enabling the option does lead to A/V
desync sometimes (if the demuxer FPS is too inaccurate), and also frame
drops at playback start in some situations. But this all seems to be
avoidable, if the timing logic were to be rewritten completely, which
should probably happen in the future. Thus the new option comes with the
warning that it can be removed any time. This is also why the option has
"hack" in the name.
2018-03-03 02:38:01 +02:00
wm4 c917992359 manpage: describe how to list/inspect/apply profiles
This is all documented elsewhere in the manpage, but hard to find from
here.
2018-03-03 02:38:01 +02:00
wm4 8288fa6978 options: add a builtin low-latency profile
Well I guess it doesn't help that much.

Also add some stuff that might help to the manpage.

The fundamental problem with some "live" sources (e.g. x11grab) is
actually that the player gets behind initially, and never thinks it has
to catch up. This is also why --untimed can help.
2018-03-03 02:38:01 +02:00
wm4 3075017ebf video: don't read ahead a frame in --untimed mode
The extra frame is used to compute the exact frame duration. But frame
drop is disabvled with --untimed.
2018-03-03 02:38:01 +02:00
wm4 16eca7139a demux_lavf: add --demuxer-lavf-probe-info=nostreams
Another attempt to try to make it behave in certain situations.
2018-03-03 02:38:01 +02:00
wm4 16d033814c demux: move some code to a separate function
No functional changes.
2018-03-03 02:38:01 +02:00
wm4 e4cb6fd0fd demux: improve audio tag merging for OGG files
It's a mess: mp3 files have user tags as global metadata (because the
id3v2 tag is global and there is only 1 stream), while OGG files have it
per-track (because it's per-stream on the lowest level). mpv needs to
try to make something nice out of the mess.

It did so by trying to detect audio-only OGG files, and then copying the
per-stream metadata to the global metadata. Make the heuristic for
detecting this slightly more clever, so it works for files with extra,
unrelated streams, like the awful libavformat cover art hack.

Fixes #5577.
2018-03-03 02:38:01 +02:00
wm4 ecf4d7a843 vo_gpu: error out if there were rendering errors when taking screenshot 2018-03-03 02:38:01 +02:00
wm4 1b786a71c1 vo_gpu: fix taking screenshots of rotated videos
Good old 90° rotation logic messing everything up.
2018-03-03 02:38:01 +02:00
wm4 628805866d vd_lavc: fix inverted condition 2018-03-03 02:38:01 +02:00
wm4 fd90c003d2 mp_image: replace rude function with less rude FFmpeg upstream function
This is new, thus a dependency bump is required.
2018-03-03 02:38:01 +02:00
wm4 14c2f20bff demux_lavf: don't mess up in streams with unknown size and init segment
The return value of stream_get_size() will be -1 if it fails. We
shouldn't mess up this value if a mp4 init segment is used.
2018-03-03 02:38:01 +02:00
wm4 6f5f92feab player: set thread name in opener thread
Somewhat helpful for debugging.
2018-03-03 02:38:01 +02:00
wm4 4184f8585d DOCS/interface-changes: add note about desyncing audio filters
For example af_loudnorm is a known filter with this behavior.
2018-03-03 02:38:01 +02:00
wm4 39e03f6072 mp_image: make ref error handling slightly readable
I think this is slightly more readable than this repeated "fail |= !".
2018-03-03 02:38:01 +02:00