Commit Graph

46307 Commits

Author SHA1 Message Date
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
wm4 55c88fdb8f mp_image: pass through unknown AVFrame side data
Useful for libavfilter. Somewhat risky, because we can't ensure the
consistency of the unknown side data (but this is a general problem with
side data, and libavfilter filters will usually get it wrong too _if_
there are conflict cases).

Fixes #5569.
2018-03-03 02:38:01 +02:00
wm4 9daa842b5f player: add warning comment about ignoring ABI safety
At least ffmpeg_garbage() uses sizeof(AVFrameSideData), which is not
included in the ABI, but there's no ABI-safe alternative either.
2018-03-03 02:38:01 +02:00
wm4 e0c67977b2 mp_image: fix subtle side data memory leaks
We must not create new references herem because mp_image_new_ref() is
called later, and actually creates new references (including doing
actual error checking). Blame C, not me.
2018-03-03 02:38:01 +02:00
wm4 6f27a165a8 demux_mkv: enable libavcodec parser for eac3
It appears some (or all) mkv files with EAC3 are muxed in a way that
breaks FFmpeg's spdifenc. I suspect it's because either dependent
substream packets are localted in their own packets, or the reverse. Or
possibly this is case where the muxer did not respect packet boundaries
at all. Enabling the EAC3 parser seems to fix this anyway, because why
waste your precious time on retarded Dolby bullshit technology? (Which
idiot came up with this shitty substream garbage?)

Observed with dolby_digital_plus_channel_check_lossless-DWEU.mkv.

Fixes #5578.
2018-03-03 02:38:01 +02:00
wm4 4a5a4b676e README: mention some semi-required FFmpeg dependencies
I think DASH playback tends to work much better with FFmpeg's DASH
demuxer, which requires libxml2.

For nvdec, FFmpeg git master now requires the external nvidia headers,
since the builtin ones were removed.
2018-03-03 02:38:01 +02:00
wm4 9f802d134b demux_edl: fix undefined behavior if mp4 init segment is not provided
param_names[n] is only valid for n<nparam.
2018-03-03 02:38:01 +02:00
Akemi 3263f47d33 cocoa-cb: fix building with SDK 10.12 and earlier
the NSWindowButton enum was moved to be a member of NSWindow and renamed
to ButtonType in SDK 10.13. apparently that wasn't documented anywhere.
not even in the SDK changes Document and the official Documentations
makes it look like it was always like this. the old NSWindowButton enum
though is still around on SDK 10.13 or at least got a typealias. so we
will just use that.
2018-03-01 21:20:24 +01:00
wm4 7ee01860d9 build: restore alphabetical sort order of file lists 2018-02-28 00:55:06 -08:00
wm4 b037121430 client API: deprecate opengl-cb API and introduce a replacement API
The purpose of the new API is to make it useable with other APIs than
OpenGL, especially D3D11 and vulkan. In theory it's now possible to
support other vo_gpu backends, as well as backends that don't use the
vo_gpu code at all.

This also aims to get rid of the dumb mpv_get_sub_api() function. The
life cycle of the new mpv_render_context is a bit different from
mpv_opengl_cb_context, and you explicitly create/destroy the new
context, instead of calling init/uninit on an object returned by
mpv_get_sub_api().

In other to make the render API generic, it's annoyingly EGL style, and
requires you to pass in API-specific objects to generic functions. This
is to avoid explicit objects like the internal ra API has, because that
sounds more complicated and annoying for an API that's supposed to never
change.

The opengl_cb API will continue to exist for a bit longer, but
internally there are already a few tradeoffs, like reduced
thread-safety.

Mostly untested. Seems to work fine with mpc-qt.
2018-02-28 00:55:06 -08:00
wm4 e76fda8594 m_option: remove unneded compatibility features
Aliases that set old options are not needed anymore. Also extend the
total size of the aliases array for one of the following commits.
2018-02-28 00:55:06 -08:00
wm4 d6921678b9 vo_gpu: remove a dead declaration 2018-02-28 00:55:06 -08:00
wm4 70b74d32cd client API: clarify license, fix some typos 2018-02-28 00:55:06 -08:00
wm4 b6c7d899ca osdep/atomic: add emulation for atomic_exchange() 2018-02-28 00:55:06 -08:00