Commit Graph

44567 Commits

Author SHA1 Message Date
wm4 240868e348 README.md: update comments about Windows hwdec/GL
We have direct rendering with hardware decoding now (so no SSE4 for
memcpy from GPU memory required), and also OpenGL drivers are not so
much of a problem anymore with ANGLE being default.
2017-03-13 12:36:44 +01:00
Akemi 076116a0e5 cocoa: set background of the title bar from black to white
due to the see-through nature of the title bar and our standard black
window background, the title bar appears dark grey opposed to the
expected light grey.

we change the window background to white but at the same time set the
background of the enclosed view to black. that way the title bar has a
white background and the background of our video stays black in all
cases. this prevents white flashing in some cases when the video is
resized with too heavy render settings.
2017-03-09 18:02:36 +01:00
Akemi ca1dd7cc61 osx: add key mappings for previous and next Media Keys
Fixes #4204
2017-03-09 18:00:16 +01:00
Akemi 7bddd3fb4c cocoa: fix autofit options on HiDPI resolutions without HiDPI scaling
Fixes #4194
2017-03-09 17:57:07 +01:00
wm4 2912210da1 vd_lavc: disable videotoolbox hack with newer ffmpeg versions
The hack becomes unnecessary with newer versions, but it's still needed
for older ones.
2017-03-07 12:20:04 +01:00
wm4 7eb32240c9 manpage: adjust description of libva deinterlacer ref direction mess
Relevant:

https://cgit.freedesktop.org/mesa/mesa/commit/?id=0798fddb5000f2b1edffc693ec65236a680ce61f

Eventually I'll just remove this option. But it's probably good to leave
it for while, possibly for letting Mesa VA driver users test and confirm
this.
2017-03-07 09:10:37 +01:00
ivan-83 e40c41de19 dvb: add support for DVB-T2
Probably does much more:

+ add support DVB-T2
* DVB params set to AUTO by default
* MAX_CARDS: 4 -> 16
* DMX_SET_BUFFER_SIZE: 64kb -> 256kb
+ add DTV_CLEAR call before tune
+ add logic from https://github.com/olifre/mpv/commits/dvb-mixed-api-scan
* rename type to delsys
* single playlist per adapter
* card -> adapter
* fix channels order in playlist
* update internal api
* auto fallback to old DVB API on tune
* fix DELSYS_SUPP_MASK value
* remove tone - unused
* add channel mem zeroize in config parser
+ add code from libdvbv5 for detect delivery systems
* SYS_DVBC_ANNEX_AC replaced to SYS_DVBC_ANNEX_A + SYS_DVBC_ANNEX_C

Signed-off-by: wm4 <wm4@nowhere>
2017-03-06 16:12:27 +01:00
Philip Sequeira b5bb006173 TOOLS/zsh.pl: don't leak regex match variables 2017-03-06 15:41:08 +01:00
Philip Sequeira a2a5fa4545 options: add M_OPT_FILE to some more file options
(Helps shell completion.)
2017-03-06 15:41:06 +01:00
Alexis Nootens 1245ac1dc5 wscript: substitute cplugins linker flag for macOS compatiblity
For an unknown reason, '-Wl -export-dynamic' doesn't work anymore
on the last macOS build (10.12.3 with Apple LLVM 8.0.0) so forcing
cplugins is useless because the check fails. Replacing the linker
option with its substitute '-rdynamic' do the trick.

The syms module from waf still works as expected and only the
symbols specified in mpv.def are exported.
2017-03-06 15:37:44 +01:00
Nicholas J. Kain e226041355 filter_kernels: Keep f.radius in terms of dest/filter coords.
The existing code modifies f.radius so that it is in terms of the
filter sample radius (in the source coordinate space) and has
some small errors because of this behavior.

This commit changes f.radius so that it is always in terms of
the filter function radius (in the destination coordinate space).

The sample radius can always be derived by multiplying f.radius
by filter_scale, which is the new, more descriptive name for the
previous inv_scale.
2017-03-06 03:31:40 +00:00
Nicholas J. Kain 69cc9f2a2c filter_kernels: Apply blur/taper before culling radius.
Modifications to the input coordinates should all be performed
before the final range check against the filter boundaries.

However, in the existing code, the blur/taper is applied after the
filter radius check is performed.  Thus, effectively the filter radius
cutoff is applied to only-downscaling-metric-modified coordinates, not
the final coordinates.

Correct this issue and restructure the returns a bit to make it
more obvious what is being done.
2017-03-06 03:31:35 +00:00
wm4 85c8556eef hw_videotoolbox: allow using native decoder output format
Depends on FFmpeg commit ade7c1a2326e2bb9b.

It has yet to show whether it actually does what it should. Probably
doesn't.
2017-03-02 11:49:12 +01:00
wm4 0aa01ca743 m_option: optionally allow passing "no" to imgfmt option types
Needed for the following commit.

Also, fix that uint32_t type - we always assumed int.
2017-03-02 11:32:07 +01:00
wm4 8fb0d2ee27 client API: update outdated recommendations about window embedding
Basically, the opengl-cb API causes fewer issues, even if it's a bit
harder on the API user.

See #4197.
2017-03-02 05:53:05 +01:00
wm4 9080e4d468 demux_lavf: get total duration from per-track durations as fallback
Apparently fixes youtube mp4 streams if avformat_find_stream_info() is
not called.

Keeping audio/video track and other track durations separate is for
the sake of embedded subtitle streams, where we want to include the
duration of overlong subtitle streams (I think).
2017-03-01 16:13:27 +01:00
wm4 ee9c850a00 vd_lavc: log pixel format requested from decoder
I find it slightly helpful in some situations.

Also change the code to have a single exit path to make this easier.
2017-03-01 16:02:08 +01:00
wm4 97403839e5 vf_vavpp: fix first-field mode
It didn't deinterlace at all. Oops.
2017-02-28 00:57:51 +01:00
wm4 75fc2bee1e vf_vavpp: add advanced deint bug compatibility for Intel vaapi drivers
I'm not sure what's going on here, but it appears kodi switches forward
and backwards references for advanced VPP deinterlacing modes. This in
turn makes deinterlacing with these modes apparently work. If you don't
switch the directions, you get a stuttering mess.

As far as the libva trace dump is concerned, this makes mpv's libva
deinterlacing API use behave like kodi's, and appears to reproduce
smooth video with advanced libva deinterlacing enabled.

I'm hearing that Mesa actually does it correctly, and I'm not sure what
will happen there. For now, passing "reversal-bug=no" as sub-option to
the vavpp filter will undo this behavior.
2017-02-28 00:57:51 +01:00
wm4 d015aab428 vf_vavpp: minor fixes
Fully initialize two structs (not doing so may or may not have been a
bug).

Actually destroy the VABufferID we create (moderate memory leak).
2017-02-28 00:57:51 +01:00
Akemi 4fe199c6a0 cocoa: improve calculation of new window position on a different screen
forcibly moving a window from one screen to another is supposed to put
it in a position that looks relative the same as on the old screen, as
in bottom, top, left and right margin look the same, without changing
the window size. in some situations the old code moved the window off
screen or on top of the menu bar so it ended up at a somewhat random
position. the new code fixes some edge cases but is probably not
completely correct since the priority is to make sure that the window
ends up on the right screen.
2017-02-28 00:01:15 +01:00
Akemi 9d549e6837 cocoa: only move window into screen bounds when changing screens
when forcibly moving windows to a different screen with --screen or
--fs-screen we need to move the window into the screen bounds if the
window is out of bounds, otherwise it can end up on the wrong screen.
previously it always recalculated the bounds and moved the window when
toggling fullscreen, now it only does the bound calculation when
changing screens.

Fixes #4178
2017-02-27 23:57:44 +01:00
Akemi 9bd819a0bc cocoa: fix segfault in certain circumstances
i falsely assumed that the windowDidChangeScreen was meant to report
‘physical’ screen changes but was wondering why it triggers on other
events too. it actually is a event that informs us when anything
referenced by our current NSScreen is changed. even when something
referenced in the NSScreen changed the old and new NSScreen are still
equal if the physical screen didn’t change. with that my previous
optimisation broke some cases where the physical screen didn’t change
but things it referenced did, leading to a segfault when theses were
accessed. to keep the optimisation we will always update our internal
NSScreen reference but the rest only when the physical screen was
changed.
2017-02-27 23:57:44 +01:00
Akemi 55fb4cb3f6 osc: fix window dragging with showwindowed=no
initialise OSC with a zero mouse area so mp_input_test_dragging returns
a proper value.

Fixes #1819
2017-02-27 23:55:30 +01:00
Akemi 2292501533 cocoa: add option to force dedicated GPU
Fixes #3242
2017-02-27 23:53:53 +01:00
Akemi b5ca8c41cc osx: drop support for OS X 10.7 and earlier 2017-02-27 23:53:53 +01:00
wm4 6028244160 ao_alsa: close audio device if polling returns POLLERR
This is apparently what happens in this situation:

    Turn off display with DPMS, turn back on with DPMS. MPV is hung.

See #4189.
2017-02-27 19:09:42 +01:00
wm4 6ace32100a ao_alsa: fix an error check
Fixes #4188 as pointed out in the issue.
2017-02-27 16:25:47 +01:00
wm4 35498d5957 vo_opengl: hwdec_d3d11egl: make it work with some ANGLE DLL versions
What a fucking waste of time. It depends on with which headers you
compile as well, so the situation is worse and more confusing than
you'd think. God knows what brain fart made them change the numeric
ID without changing the extension name or any other ways to keep
ABI-compatibility and without any warning.
2017-02-27 15:40:11 +01:00
wm4 6e3fbaba7e decode: fix extra surface count
FFmpeg could crash with vaapi (new) and --vo=opengl + interpolation.

It seems the actual surface count the old vaapi code uses (and which
usually never exceeded the preallocated amount) was higher than what
was used for the new vaapi code, so just correct that. The d3d helpers
also had weird code that bumped the real pool size, fix them as well.

Why this would result in an assertion failure instead of a proper error,
who knows.
2017-02-27 14:41:24 +01:00
wm4 9714e04e94 vf_vavpp: always limit forward/backward surfaces to requested number
Don't give the driver more forward/backward refernces than it requested
in num_forward_references/num_backward_references. This shouldn't
matter, I'm just trying to play it safe.
2017-02-27 14:19:41 +01:00
wm4 e9cda168c0 vf_vavpp: remove apparently broken change-detection
This is probably wrong. Just don't bother with it. The only potentially
negative effect is from calling vaQueryVideoProcPipelineCaps() every
frame.
2017-02-27 14:18:04 +01:00
wm4 2b6ac866c0 vo_opengl: use misc/ctype.h instead of <ctype.h>
Locale-independent, and doesn't have the char vs. unsigned char problem.
(Although in this case, the code was fine, because bstr.start is
unsigned char.)
2017-02-25 14:33:27 +01:00
wm4 eacf4a7d9b client: call certain external functions outside of client lock
Fixes theoretical lock-order issues found by Coverity. Calling these
inside the log is unnecessary anyway, because they have their own
locking, and because mpv_detach_destroy() needs to be called by someone
who has exclusive access to the mpv_handle (it's basically a destructor
function). The lock order issues comes from the fact that they call back
into the client API implementation to broadcast events and such.
2017-02-24 08:54:52 +01:00
wm4 6f8c953042 demux_lavf: skip avformat_find_stream_info() for some formats
Includes hls, mp4, mkv by default. This also avoids stupid things like
decoding at least 1 video frame per stream in the demuxer.

This also add --demuxer-lavf-probe-info to give finer control over what
happens.
2017-02-23 18:18:22 +01:00
wm4 992e582488 lavfi: temporary workaround for FFmpeg av_buffersrc_parameters_set() bug
The function ignores AVBufferSrcParameters.channel_layout. Set it
manually using the API.
2017-02-22 10:43:35 +01:00
Akemi c824a023c4 cocoa: fix dragging out of focus window
fffab30 introduced a small regression where the cursor couldn't be
unhidden after refocusing. the problem is that no mouseUp event was
reported in our events_view. work around this with a separate event
monitor. this also fixes another regression when the window is being
dragged from the title bar.

#4174
2017-02-21 19:26:33 +01:00
wm4 aeddc499d8 player: don't block playback stop when seeking
This was added for A-B loops, but it looks like commit a1dec6f5 made
this code unnecessary. Remove it, because it has the annoying
side-effect of blocking playback stop when seeking past the end.
2017-02-21 15:39:44 +01:00
wm4 13d2eb8eb9 player: fix stats-logging of sleep state 2017-02-21 15:39:44 +01:00
wm4 7dd81c3f96 player: remove unnecessary wakeup
I can't find any actual need for it.
2017-02-21 15:39:44 +01:00
wm4 eae12bf963 vo: fix subtleties in the redrawing logic
This fixes a race condition created by the previous commit, and possibly
others. Sometimes interpolated frames weren't redrawn as uninterpolated
ones.

The problem is that redrawing/drawing a frame can't reset the VO
want_redraw flags, because logically these have to happen after the core
acknowledged and explicitly reissued a redraw. The core needs to be
involved because the OSD text and drawings could depend on the playback
or window state.

Change it such that it always goes through the core.

Also, VOs inconsistently called vo_wakeup() when setting want_redraw,
which is also taken care of by this commit.
2017-02-21 15:39:44 +01:00
wm4 3cd29ca031 player: reduce blocking on VO when switching pause
When pausing, we sent BOCTRL_PAUSE and VOCTRL_RESTORE_SCREENSAVER. These
essentially wait until the video frame has been rendered. This is a
problem with the opengl-cb, if GL rendering is done in the same thread
as libmpv uses. Unfortunately, it's allowed to use opengl-cb this way.

Logically speaking, it's a deadlock situation, which is resolved with a
timeout. This can lead to quite ugly effects, like the on-pause frame
not being rendered until the timeout has passed. It has been interpreted
as video continuing to play.

Resolve this by simply not blocking on pause. Make the screensaver
controls async, and handle sending VOCTRL_PAUSE in the VO thread.

(All this could be avoided by redoing the internal VO API.)

Also see #4152.
2017-02-21 15:39:40 +01:00
wm4 e85d06baad img_format: stop setting some fields to dummy values for hwaccel formats
Flags like MP_IMGFLAG_YUV were meaningless for hwaccel formats, and
setting fields like component_bits made even less sense.
2017-02-21 10:35:38 +01:00
wm4 b258327210 mp_image: for hwaccel, use underlying fmt in mp_image_params_guess_csp()
If imgfmt is a hwaccel format, hw_subfmt will contain the CPU equivalent
of the data stored in the hw frames.

Strictly speaking, not doing this was a bug, but since hwaccel formats
were tagged with MP_IMGFLAG_YUV, it didn't have much of an impact.
2017-02-21 10:34:26 +01:00
Kevin Mitchell df30b217d9 ao: never set ao->device = ""
For example, previously, --audio-device='alsa/' would provide ao->device="" to
the alsa driver in spite of the fact that this is an already parsed option. To
avoid requiring a check of ao->device[0] in every driver, make sure this never
happens.
2017-02-20 22:56:30 -08:00
Akemi fffab30a3e cocoa: only report mouse movements when window is not being dragged
even though the mouse doesn’t move relative to the window itself, when
the window is being dragged, some outliers are still reported and
trigger the OSC.
2017-02-20 17:26:56 +01:00
Akemi bdd096db9a cocoa: make window draggable on init
fixes the case when mpv is opened and the cursor is within the window
bounds without moving the mouse. previously the window could only be
dragged around after the first mouse movement.
2017-02-20 17:25:42 +01:00
wm4 5519d0dde4 stream_cb: remove leftover doxygen line 2017-02-20 15:32:31 +01:00
rr- 326920a9bf vo_tct: check ioctl result 2017-02-20 14:19:57 +01:00
wm4 8c701587c8 image_writer: check a return value
Doesn't matter, since it's the flush call, but be nice. In particular,
don't upset coverity.
2017-02-20 14:05:14 +01:00