0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
Commit Graph

38749 Commits

Author SHA1 Message Date
wm4
4f984b987c video: add --display-fps switch to control framedrop FPS
Since the display FPS is currently detected on X11 only (and even there
it's known to be wrong on certain setups), it seems like a good idea to
make this user-configurable.
2014-08-16 00:05:02 +02:00
wm4
07aba86b37 audio: add a mode to insert silence on severe A/V desync
This is probably a stupid idea, but it can't be denied that this
actually allows playing video without larger desync, even if video is
too slow.
2014-08-15 23:52:42 +02:00
wm4
72ee9bb56c vo_opengl: optional support for using GLX_SGI_video_sync
I'm not sure about the merit, though it does print nice numbers if debug
output is enabled.

Basically, this tries to achieve similar results as the glFinish()
business, but again it entirely depends on the drivers whether this
does anything meaningful, or whether it's actively harmful.
2014-08-15 23:36:13 +02:00
wm4
db65151890 gl_common: add SGI_video_sync extension 2014-08-15 23:36:10 +02:00
wm4
4a297554bc vo_opengl: if glfinish is used, also call it after swappping
It seems that at least on nvidia systems with composting disabled, we
can get it to block deterministically on the actual vsync event, which
should improve framedropping.
2014-08-15 23:36:02 +02:00
wm4
543ba6c114 video: add VO framedropping mode
This mostly uses the same idea as with vo_vdpau.c, but much simplified.

On X11, it tries to get the display framerate with XF86VM, and limits
the frequency of new video frames against it. Note that this is an old
extension, and is confirmed not to work correctly with multi-monitor
setups. But we're using it because it was already around (it is also
used by vo_vdpau).

This attempts to predict the next vsync event by using the time of the
last frame and the display FPS. Even if that goes completely wrong,
the results are still relatively good.

On other systems, or if the X11 code doesn't return a display FPS, a
framerate of 1000 is assumed. This is infinite for all practical
purposes, and means that only frames which are definitely too late are
dropped. This probably has worse results, but is still useful.

"--framedrop=yes" is basically replaced with "--framedrop=decoder". The
old framedropping mode is kept around, and should perhaps be improved.
Dropping on the decoder level is still useful if decoding itself is too
slow.
2014-08-15 23:33:33 +02:00
wm4
22a9529012 vo: eliminate a redundant variable
Originally, I probably had plans to allow NULL images to handle things
like the last frame case, but that idea was dropped later.
2014-08-15 23:32:45 +02:00
wm4
fa7c421588 player: use virtual time for --audio-file with ordered chapters
Apparently users prefer this behavior.

It was used for subtitles too, so move the code to calculate the video
offset into a separate function. Seeking also needs to be fixed.

Fixes #1018.
2014-08-15 23:32:37 +02:00
wm4
318e8da250 lua: wake up the core when setting OSD
The OSD is marked as changed, but the core isn't notified and this
doesn't immediately wakeup. (Possibly the OSD code should wakeup the
core instead, but maybe that woudl be overkill.)

Observed when using "mp.use_suspend = false" in the OSC, and pausing,
and moving the mouse pointer out of the window. The last part of the
fade remained visible for longer than intended.
2014-08-15 23:32:31 +02:00
ChrisK2
364e06261a osc: Overhaul (wip)
Code reorganized to make layouts exchangeable
alternative test layout can be tested with
layout=slimbox
in the OSC config

timers are now used to properly animate the fade out when the
player is paused

duplicate seeks are discarded again
2014-08-15 15:24:22 +02:00
wm4
d5940fabcd sub: add option to workaround broken mkv files
See additions to options.rst.
2014-08-14 23:59:35 +02:00
wm4
498644afaf sub: call sub_reset() on seeks only
sub_reset() was called on cycling subtitle tracks and on seeking. Since
we don't want that subtitles disppear on cycling, sd_lavc.c didn't clear
its internal subtitle queue on reset, which meant that seeking with PGS
subtitles could leave the subtitle on screen (PGS subtitles usually
don't have a duration set).

Call it only on seeking, so we can also strictly clear the subtitle
queue in sd_lavc.

(This still can go very wrong if you disable a subtitle, seek, and
enable it again - for example, if used with libavformat that uses "SSA"
style demuxed ASS subtitle packets. That shouldn't happen with newer
libavformat versions, and the user can "correct" it anyway by executing
a seek while the subtitle is selected.)
2014-08-14 23:53:53 +02:00
wm4
a7107686d7 client API: directly lock playloop
Until recently, vo_opengl could be accessed from a single thread only,
due to the OpenGL API context being thread-specific. This issue doesn't
exist anymore, because VOs run on their own thread. This means we can
simply lock/unlock the playloop instead of doing something complicated
to get the playloop thread to execute our code.
2014-08-14 19:40:43 +02:00
wm4
8f77d9df4a lua: allow disabling suspend
I'd like to enable this by default, but unfortunately the OSC seems to
have some problems with it.
2014-08-14 19:30:35 +02:00
wm4
a31330608b client API: adjust documentation for mpv_suspend()
It's not true anymore that the core will stop replying for 50ms
(waiting for video) without calling this function. Simplify the
documentation accordingly. Accessing properties that go through
the VO still have this problem, though.
2014-08-14 19:29:21 +02:00
wm4
51a7070e26 vo: remove unused libavutil include 2014-08-14 19:29:02 +02:00
wm4
de399278fc vo: fix mingw compilation 2014-08-14 01:30:20 +02:00
wm4
061a5af544 demux_lavf: support new metadata update API
This Libav-invented API is of course completely different from the
FFmpeg-one. (The fun part is that I approved of both.)
2014-08-14 01:18:18 +02:00
Alessandro Ghedini
e7cab32fae TOOLS/zsh.pl: properly set the return value
The previous commit made the completion script always return non-zero, even when
a match is found. This explicitly sets the return value to zero whenever a match
is found but defaults to non-zero in case nothing is matched.
2014-08-13 23:42:38 +02:00
c_14
fd98863b1f TOOLS/zsh.pl: properly return non-zero when no matches are found
Returning a non-zero value signals to the zsh completion system that no matches
were added by the script so that it can try the user-defined matchers (e.g.
those defined with matcher-list).

Fixes #1008.
2014-08-13 22:57:59 +02:00
Alexander Preisinger
69a160f187 wayland: pointer interface is created after theme
Just always load the theme. It gets freed properly and dosn't bother anyone.

Fixes #1012.

CC: @mpv-player/stable
2014-08-13 22:34:18 +02:00
wm4
3eaa407c6f video: reduce non-sense messages when playing coverart
Don't print PTS warnings by skipping the normal video path.
2014-08-13 22:01:10 +02:00
wm4
b0959488d1 video: don't run new frame processing on every iteration
This ran adjust_sync() on every playloop iteration, instead of every
newly decoded frame. It seems this was idempotent in the common case,
but the code was originally designed to be run once only, so restore
that.
2014-08-13 22:01:10 +02:00
wm4
4a325a8592 video: move some more code around
No functional changes.
2014-08-13 22:01:09 +02:00
wm4
48bd1294eb video: move some code around 2014-08-13 21:53:47 +02:00
wm4
311ce60b16 video: exit early when nothing to do
These cases were probably confusing. Exit early, which makes it much
clearer what's going on. Should not change anything functionally.
2014-08-13 21:51:26 +02:00
wm4
d4e0fc76bb video: minor simplification of the old framedrop code
No changes in functionality, other than being slightly more correct at
stream EOF.
2014-08-13 21:50:23 +02:00
wm4
010b86fd34 player: don't quit with --loop-file
Fixes #1009.

CC: @mpv-player/stable
2014-08-13 21:50:01 +02:00
Alessandro Ghedini
2607d6e419 vdpau: correctly mark invalid mixer as such on vdp_video_mixer_create() failure
Otherwise vdp_video_mixer_destroy() would later fail when called on an invalid
video mixer handle. With mesa r600 vdpau driver, this would cause a segfault.
2014-08-13 17:57:19 +02:00
Jan Palus
69d5356d76 build: fix libmpv build when using system waf
Since the 'syms' tool is shipped in waf's extras, when using system waf the
default tool overrides our own. Force our syms tool by providing the tooldir.

Fixes #1006
2014-08-13 17:09:45 +02:00
wm4
9ed9c68fda vo_vdpau: fix screenshots with anamorphic video
Fixes #1007.

CC: @mpv-player/stable
2014-08-13 00:52:05 +02:00
wm4
f6f93b6336 x11: vdpau GLX interop needs X11 threads
Xlib is not thread-safe. Or actually it is, but it's an incomprehensible
hack that was added later, and which needs to be acitvated manually
(this makes no sense). And it appears that the vdpau accesses X from the
decoder thread if GLX interop is used (and not in any other situations -
this doesn't make too much sense either).

So, just call the magic function that enables Xlib thread-safety.
2014-08-13 00:26:13 +02:00
wm4
defa0a20e0 af_lavcac3enc: lower minimum channel number to 3
It seems only stereo PCM should be passed through.
2014-08-12 23:45:41 +02:00
FRAU KOUJIRO
060ba226e6 docs: cocoa example uses wakeup callback API
Also, imitate the qt example somewhat.
2014-08-12 23:40:58 +02:00
FRAU KOUJIRO
dcf4ee905b docs: simple cocoa API usage example 2014-08-12 23:40:55 +02:00
wm4
be792c085a af_lavcac3enc: change default bitrate to 640
No reason to use less.

Since the name "default" is misleading now, replace it with "auto"
(still recognize the old name).
2014-08-12 23:34:28 +02:00
wm4
5ed7bc6321 video: fix and simplify video format changes and last frame display
The previous commit broke these things, and fixing them is separate in
this commit in order to reduce the volume of changes.

Move the image queue from the VO to the playback core. The image queue
is a remnant of the old way how vdpau was implemented, and increasingly
became more and more an artifact. In the end, it did only one thing:
computing the duration of the current frame. This was done by taking the
PTS difference between the current and the future frame. We keep this,
but by moving it out of the VO, we don't have to special-case format
changes anymore. This simplifies the code a lot.

Since we need the queue to compute the duration only, a queue size
larger than 2 makes no sense, and we can hardcode that.

Also change how the last frame is handled. The last frame is a bit of a
problem, because video timing works by showing one frame after another,
which makes it a special case. Make the VO provide a function to notify
us when the frame is done, instead. The frame duration is used for that.

This is not perfect. For example, changing playback speed during the
last frame doesn't update the end time. Pausing will not stop the clock
that times the last frame. But I don't think this matters for such a
corner case.
2014-08-12 23:24:08 +02:00
wm4
df58e82237 video: move display and timing to a separate thread
The VO is run inside its own thread. It also does most of video timing.
The playloop hands the image data and a realtime timestamp to the VO,
and the VO does the rest.

In particular, this allows the playloop to do other things, instead of
blocking for video redraw. But if anything accesses the VO during video
timing, it will block.

This also fixes vo_sdl.c event handling; but that is only a side-effect,
since reimplementing the broken way would require more effort.

Also drop --softsleep. In theory, this option helps if the kernel's
sleeping mechanism is too inaccurate for video timing. In practice, I
haven't ever encountered a situation where it helps, and it just burns
CPU cycles. On the other hand it's probably actively harmful, because
it prevents the libavcodec decoder threads from doing real work.

Side note:

Originally, I intended that multiple frames can be queued to the VO. But
this is not done, due to problems with OSD and other certain features.
OSD in particular is simply designed in a way that it can be neither
timed nor copied, so you do have to render it into the video frame
before you can draw the next frame. (Subtitles have no such restriction.
sd_lavc was even updated to fix this.) It seems the right solution to
queuing multiple VO frames is rendering on VO-backed framebuffers, like
vo_vdpau.c does. This requires VO driver support, and is out of scope
of this commit.

As consequence, the VO has a queue size of 1. The existing video queue
is just needed to compute frame duration, and will be moved out in the
next commit.
2014-08-12 23:24:08 +02:00
wm4
a1be3cf147 DOCS: mark the recent release in client-api-changes.rst
Also add instructions to release-policy.md, since this can be easily
forgotten.

CC: @mpv-player/stable
2014-08-12 23:01:19 +02:00
wm4
52f2f67553 input.conf: add some bindings for changing audio-delay
Requested on: 90ec333417 (commitcomment-7331673)

Might remove or remap them again later.
2014-08-11 23:40:35 +02:00
wm4
3f353f1219 input.conf: make explanatory text more readable
Or at leats this is the intention. It's a bit hard to tell which
information is needed, and which not.
2014-08-11 23:32:37 +02:00
wm4
b8f025a58a video: don't keep multiple pointers to hwdec info struct
This makes a certain corner case simpler at a later point.
2014-08-11 23:09:39 +02:00
wm4
056622c33e vaapi: fix uninitialized value read
Found with valgrind. This is somewhat terrifying, because the VA-API API
function is supposed to fill these values, and we access them only if
the API functions return success. So this shouldn't have happened.
2014-08-11 21:57:41 +02:00
wm4
beceb2fedc vf_vapoursynth: print more diagnostics on error 2014-08-11 21:57:15 +02:00
wm4
bead9766bc manpage: update keybindings 2014-08-11 21:56:37 +02:00
wm4
f9d2ad6c17 Move status-line.lua
Looks like TOOLS/lua/ is now established as dumping ground for random
Lua scripts, so DOCS/lua_examples/ is not needed anymore.
2014-08-11 17:08:32 +02:00
wm4
0ed48f5ec9 player: remove cache status from video OSD 2014-08-11 17:01:20 +02:00
wm4
9dd160ea97 demux: reduce log spam if threading is disabled 2014-08-11 15:55:12 +02:00
wm4
37357e2265 video: fix dangling pointer issue
The function video_decode_and_filter(), called between initializing the
local vf variable and using it, can actually destroy and recreate the
filter. Thus, the vf variable turns into a dangling pointer if that
happens.

Could be observed with: --hwdec=vda --deinterlace=yes --vf=yadif

(Also happens with vdpau/vaapi.)
2014-08-11 15:37:13 +02:00
wm4
33a8e2a9ad vdpau: allocate surfaces by age
Whether this helps is probably questionable and depends on the GPU. But
the vaapi code does it too.
2014-08-11 14:03:53 +02:00