Compare commits

...
43 Commits
Author SHA1 Message Date
Alessandro Ghedini 973b555672 Release 0.6.2 2014-10-24 20:38:45 +02:00
wm4 0a40fb00b4 player: fix exiting if both audio and video fail initializing
The player was supposed to exit playback if both video and audio failed
to initialize (or if one of the streams was not selected when the other
stream failed). This didn't work; for one this check was missing from
one of the failure paths. And more importantly, both checked the
current_track array incorrectly.

Fix these issues, and move the failure handling code into a common
function.

CC: @mpv-player/stable

Conflicts:
	player/audio.c
	player/video.c
2014-10-23 20:27:32 +02:00
wm4 3c8aecb711 sub: adjustments to --ass-style-override option
Now requires newest libass git. Since this feature wasn't part of a
libass release yet, I'm not bothering making the mpv code compatible
with as how it was previously implemented (it will just be disabled
with any older libass).

CC: @mpv-player/stable (because mpv-build uses libass git, and this
                        breaks the feature)
2014-10-18 15:05:51 +02:00
wm4 b3707f4e21 audio: don't go to sleep after audio reinit
It possibly goes to sleep without actually starting to decode audio.
Possibly fixes a problem with --no-osc --no-video reported on IRC.

CC: @mpv-player/stable
2014-10-18 15:05:46 +02:00
wm4 af58a8c324 terminal: recognize ^h
Fixes #1185.

CC: @mpv-player/stable
2014-10-18 15:05:35 +02:00
shdown 3fae6aaae8 player: quote %-starting strings
Leading percent sign is a quote indicator so it needs to be quoted
itself.
2014-10-18 15:04:54 +02:00
shdown 919540ce8e common: fix \x-style escaping
This was rejecting correct escapes and accepting incorrect ones.
2014-10-18 15:04:46 +02:00
shdown ad9d1a3fb7 manpage: fix reference to a defunct option
The change was made with faad40aad9.
2014-10-18 15:04:27 +02:00
wm4 f16b1cdc17 player: fix crash on early audio uninit
Could crash when exiting playback in very early stages of
initialization.

CC: @mpv-player/stable
2014-10-16 13:13:26 +02:00
wm4 f2e289dc80 player: fix --frames
This could produce an extra frame, because reaching the maximum merely
signals the playloop to exit, without strictly enforcing the limit.

Fixes #1181.

CC: @mpv-player/stable
2014-10-15 15:15:58 +02:00
wm4 4a0e50d2a6 player: signal EOF when using --frames 2014-10-15 15:15:53 +02:00
wm4 a6eb0714fa demux_mkv: fix undefined behavior
With some files, the extradata variable can remain uninitialized, but
will be used for memory access.

CC: @mpv-player/stable (with high priority)
2014-10-15 15:13:47 +02:00
Alessandro Ghedini 7d9f8f75ea Release 0.6.1 2014-10-12 14:25:35 +02:00
wm4 2ffdc0da13 af_lavcac3enc: fix byte order
Oops.

Fixes #1172.

CC: @mpv-player/stable
2014-10-12 12:43:12 +02:00
wm4 7ae6484cd4 gl_x11: distinguish missing GLX and too old GLX versions
This probably led to confusing output.

CC: @mpv-player/stable
2014-10-12 12:43:08 +02:00
wm4 08d144138b command: don't display non-sense if volume is unavailable
Showed "Volume: (unavailable)%". That was dumb.

The message string is now a bit convoluted; mostly because the property
expand syntax can't do "if-else", just "if".

CC: @mpv-player/stable
2014-10-12 12:43:05 +02:00
wm4 58b511d947 build: install input config files into doc dir
Users using binary packages don't have obvious access to them, so this
seems like a good idea.
2014-10-12 12:42:59 +02:00
wm4 9b8b2933f3 etc/mplayer-input.conf: fix off by one error
playlist-pos is 0-based, but everyone thinks it's 1-based. Stupid crap.

(The "not the same as MPlayer" refers to a playlist manipulation command
that doesn't exist anymore in mpv.)

CC: @mpv-player/stable
2014-10-11 14:08:59 +02:00
wm4 24c05b2a82 player: don't mess up cursor visibility state
Manually setting can break things forever, because it puts the VO cursor
state out of sync with the remembered state by handle_cursor_autohide().
Use the normal autohide code during idle mode too instead. (Originally
the idea was to make the cursor always visible in idle mode, but not so
important.)

Regression since e1e8b07c. Fixes #1166.

CC: @mpv-player/stable

Conflicts:
	player/playloop.c
2014-10-11 14:08:29 +02:00
wm4 1412b0171d audio/out/push: make draining slightly more robust
Don't wait after the audio thread has pushed the remaining audio to the
AO. Avoids hard hangs if the heuristic fails completely (could still
happen if get_delay returns absurd values).

CC: @mpv-player/stable
2014-10-11 14:03:13 +02:00
wm4 5c1c99b858 audio/out/push: fix EOF heuristic
Since the internal AO driver API has no proper way to determine EOF, we
need to guess by querying get_delay. But some AOs (e.g. ao_pulse with
no-latency-hacks set) may never reach 0, maybe because they naively add
the latency to the buffer level. In this case our heuristic can break.

Fix by always using the delay to estimate the EOF time. It's not even
that important - it's mostly used to avoid blocking draining. So this
should be ok.

CC: @mpv-player/stable (maybe)
2014-10-11 14:03:08 +02:00
wm4 f66e320d7b video: try harder to decode cover art picture only once
For cover art, we pretend that the video stream is infinite, but also
stop decoding once we have an image on the VO (this seems advantageous
for the case when strange filters are inserted or the VO image gets
lost). Since a while ago, the video chain started decoding 2 images
though ("Non-monotonic video pts: 0.000000 <= 0.000000"), which is
annoying and wasteful.

Improve this by handling a certain corner case at initialization, which
will decode a second image while the first one is still stuck in the
filter chain. Also, just in case there are filters which buffer a lot,
also force EOF filtering (which means we tell the filters to flush
buffered frames).

CC: @mpv-player/stable
2014-10-11 14:01:21 +02:00
wm4 fa2381765e vf_lavfi: fix compilation failure
Apparently this fails to compile with clang6. Patch by someone else.

CC: @mpv-player/stable
2014-10-11 14:00:52 +02:00
wm4 f220617267 demux_lavf: blacklist jpeg files
We handle them under demux_mf.c for stupid reasons; mostly so that
an image is shown for a second instead of just flashing it.

CC: @mpv-player/stable
2014-10-11 13:59:54 +02:00
wm4 381843eb88 ao_pulse: don't use pa_format_info_to_sample_spec()
This function is available starting with PulseAudio 2.0, while we only
require 1.0. This broke compilation on Ubuntu 12.04.5 LTS.

Use our own function to calculate the buffer size, which is actually
simpler and needs slightly less code.

Hopefully fixes #1154.
CC: @mpv-player/stable
2014-10-11 13:59:43 +02:00
wm4 9258d0461e audio/out/push: fix some AOs freezing on exit
Caused by a dumb deadlock.
2014-10-11 13:59:22 +02:00
wm4 e2f59fcabd etc: add an input config file that reverts recent key binding changes
This is for users who don't like changes. I'm hoping it will make the
process of cleaning up key bindings less bumpy.

It should be mentioned in the release notes of the next release.
2014-10-11 13:58:53 +02:00
wm4 5b76ce3865 audio/out/push: make draining more robust
It was more complicated than it had to be: the audio thread already
determines whether audio has ended, so we can use that. Remove the
separate logic for draining.
2014-10-11 13:57:40 +02:00
wm4 1b29964a3e audio/out/push: limit fallback sleep time to reasonable limits 2014-10-11 13:57:34 +02:00
wm4 180fed4bc4 ao_pulse: change suspend circumvention logic
Commit 957097 attempted to use PA_STREAM_FAIL_ON_SUSPEND to make
ao_pulse exit if the stream was started suspended.

Unfortunately, PA_STREAM_FAIL_ON_SUSPEND is active even during playback.
If you pause mpv, pulseaudio will close the actual audio device after a
while (or something like this), and unpausing won't work. Instead, it
will spam "Entity killed" error messages.

Undo this change and check for suspended audio manually during init.

CC: @mpv-player/stable
2014-10-11 13:57:03 +02:00
Alessandro Ghedini fb3bf1ae81 vf_stereo3d: fix "auto" input format with libav 2014-10-11 13:56:43 +02:00
Kevin Mitchell f842b3f2b2 manpage: improve consistency with new ~/.config/mpv default
Signed-off-by: wm4 <wm4@nowhere>
2014-10-11 13:56:06 +02:00
wm4 e4f6235a47 player: properly wakeup when delaying OSD
Not sure in which situations this could make a difference; probably
none in practice, but it's more correct.

CC: @mpv-player/stable
2014-10-11 13:55:27 +02:00
wm4 89df07aa6d video: return responsibility of video redraw back to playloop
When the VO was moved it its own thread, responsibility for redrawing
was given to the VO thread itself. So if there was a condition that
indicated that redrawing was required, like expose events or certain
VOCTRLs, the VO thread was redrawing itself.

This worked fine, but there are some corner cases where this works
rather badly. E.g. if I fullscreen the player and hit panscan controls
with mpv's default autorepeat rate, playback stops. This happens because
the VO redraws itself after every panscan change command. Running each
(repeated) command takes so long due to redrawing and (involuntary)
waiting on vsync, that it never leaves the input processing loop while
the key is held down. I suspect that in my case, redrawing in fullscreen
mode just gets slow enough that it takes 2 vsyncs instead of 1 on
average, and the processing time gets larger than the autorepeat delay.

Fix this by taking redraw control from the VO, and instead let the
playloop issue a "real" redraw command to the VO if needed. This
basically reverts redraw handling to what it was before moving the VO to
a thread.

CC: @mpv-player/stable
2014-10-11 13:55:22 +02:00
Stephen Caraher 04a8dd38d5 man: replaced : with , in broken --lua-opts osc example
--lua-opts is a key-value list, so the option parser accepts only commas.

Signed-off-by: wm4 <wm4@nowhere>
CC: @mpv-player/stable
2014-10-11 13:54:10 +02:00
wm4 72e881b60d command: don't show message on "osd" command by default
Apparently this was not very popular.

CC: @mpv-player/stable
2014-10-11 13:54:00 +02:00
wm4 45b99d9799 manpage: remove non-existing ratio-pos property
Use percent-pos instead, which is exactly the same, except with the
range 0.0-100.0.

I'm not sure how this got there; it was probably introduced and then
removed again as percent-pos got more precise.

CC: @mpv-player/stable
2014-10-11 13:53:47 +02:00
wm4 b784083fb5 x11: fix --wid=0
Another fallout resulting from the changes whether or not to wait for
mapping the window. In this case, it obviously makes no sense to wait
for mapping, because the root window is always mapped. Mapping will
never happen, and it would wait forever.

Fixes #1139.
CC: @mpv-player/stable
2014-10-11 13:53:41 +02:00
wm4 d7cf596e2a manpage: redocument audio delay key bindings
Fixes #1131.
CC: @mpv-player/stable
2014-10-11 13:53:34 +02:00
wm4 a2e38ca657 player: don't print audio/video init failure message twice
The messages "Audio: no audio" and "Video: no video" could be printed
twice each if initializing them failed. Prevent his silliness.

CC: @mpv-player/stable
2014-10-11 13:53:27 +02:00
wm4 3e410f423d vo_vdpau: don't try to create surfaces of size 0
At least on kwin, we decide to proceed without waiting for the window
being mapped (due to the frame exts hack, see commit 8c002b79). But that
leaves us with a window size of 0x0, which causes VdpOutputSurfaceCreate
to fail. This prints some warnings, although vo_vdpau recovers later and
this has no other bad consequences.

Do the following things to deal with this:
- set the "known" window size to the suggested window size before the
  window is even created
- allow calling XGetGeometry on the window even if the window is not
  mapped yet (this should work just fine)
- make the output surface minimum size 1x1

Strictly speaking, only one of these would be required to make the
warning disappear, but they're all valid changes and increase robustness
and correctness. At no point we use a window size of 0x0 as magic value
for "unset" or unknown size, so keeping it unset has no purpose anyway.

CC: @mpv-player/stable
2014-10-11 13:51:53 +02:00
wm4 061f509757 demux_disc: bluray: fix stream language (2)
Commit 50e131b43e happened to make it work for DVD (because the higher
bits of the ID are masked in the DVD case), but failed for Bluray. This
probably fixes it, although I don't have a sample to multiple streams to
confirm it really does it right.

CC: @mpv-player/stable
2014-10-11 13:51:41 +02:00
Alessandro Ghedini 03bfc2b3fd Release 0.6.0 2014-09-30 20:52:47 +02:00
36 changed files with 347 additions and 135 deletions

No files matched your search

+1
View File
@@ -25,6 +25,7 @@ API changes
::
--- mpv 0.6.0 is released ---
1.5 - change in X11 and "--wid" behavior again. The previous change didn't
work as expected, and now the behavior can be explicitly controlled
with the "input-x11-keyboard" option. This is only a temporary
+5 -7
View File
@@ -11,8 +11,9 @@ value (upper case if combined with ``Shift``), or a name for special keys. For
example, ``a`` maps to the ``a`` key without shift, and ``A`` maps to ``a``
with shift.
The file is normally located in ``~/.config/mpv/input.conf`` (some platforms
may use different paths). The default bindings are defined here::
The file is located in the mpv configuration directory (normally at
``~/.config/mpv/input.conf`` depending on platform). The default bindings are
defined here::
https://github.com/mpv-player/mpv/blob/master/etc/input.conf
@@ -668,9 +669,6 @@ Property list
estimating the playback position from the byte position, if the file
duration is not known.
``ratio-pos`` (RW)
Position in current file (0.0-1.0). higher precision that ``percent-pos``.
``time-pos`` (RW)
Position in current file in seconds.
@@ -1139,8 +1137,8 @@ Property list
See ``--ass-style-override``.
``stream-capture`` (RW)
A filename, see ``--capture``. Setting this will start capture using the
given filename. Setting it to an empty string will stop it.
A filename, see ``--stream-capture``. Setting this will start capture using
the given filename. Setting it to an empty string will stop it.
``tv-brightness``, ``tv-contrast``, ``tv-saturation``, ``tv-hue`` (RW)
TV stuff.
+13 -11
View File
@@ -1,11 +1,12 @@
LUA SCRIPTING
=============
mpv can load Lua scripts. Scripts in ``~/.mpv/lua/`` will be loaded on program
start, or if passed to ``--lua``. mpv appends ``~/.mpv/lua`` to the end of
lua's path so you can import them too. Since it's added to the end, don't name
scripts you want to import the same as lua libraries because they will be
overshadowed by them.
mpv can load Lua scripts. Scripts passed to the ``--lua`` option, or found in
the ``lua`` subdirectory of the mpv configuration directory (usually
``~/.config/mpv/lua/``) will be loaded on program start. mpv also appends the
``lua`` subdirectory to the end of Lua's path so you can import scripts from
there too. Since it's added to the end, don't name scripts you want to import
the same as Lua libraries because they will be overshadowed by them.
mpv provides the built-in module ``mp``, which provides functions to send
commands to the mpv core and to retrieve information about playback state, user
@@ -32,12 +33,13 @@ allow users implement features which are not going to be added to the mpv core.
Mode of operation
-----------------
Your script will be loaded by the player at program start from ``~/.mpv/lua/``,
or ``--lua``, or in some cases, internally (like ``--osc``). Each script runs
in its own thread. Your script is first run "as is", and once that is done,
the event loop is entered. This event loop will dispatch events received by mpv
and call your own event handlers which you have registered with
``mp.register_event``, or timers added with ``mp.add_timeout`` or similar.
Your script will be loaded by the player at program start from the ``lua``
configuration subdirectory, from a path specified with the ``--lua`` option, or
in some cases, internally (like ``--osc``). Each script runs in its own
thread. Your script is first run "as is", and once that is done, the event loop
is entered. This event loop will dispatch events received by mpv and call your
own event handlers which you have registered with ``mp.register_event``, or
timers added with ``mp.add_timeout`` or similar.
When the player quits, all scripts will be asked to terminate. This happens via
a ``shutdown`` event, which by default will make the event loop return. If your
+6 -3
View File
@@ -126,6 +126,9 @@ j and J
x and z
Adjust subtitle delay by +/- 0.1 seconds.
Ctrl + and Ctrl -
Adjust audio delay by +/- 0.1 seconds.
V
Toggle subtitle VSFilter aspect compatibility mode. See
``--ass-vsfilter-aspect-compat`` for more info.
@@ -262,7 +265,7 @@ need to escape special characters. To work this around, the path can be
additionally wrapped in the ``%n%string_of_length_n`` syntax (see above).
Some mpv options interpret paths starting with ``~``. Currently, the prefix
``~~/`` expands to the mpv configuration directory (usually ``~/.mpv/``).
``~~/`` expands to the mpv configuration directory (usually ``~/.config/mpv/``).
``~/`` expands to the user's home directory. (The trailing ``/`` is always
required.)
@@ -352,11 +355,11 @@ File-specific Configuration Files
You can also write file-specific configuration files. If you wish to have a
configuration file for a file called 'video.avi', create a file named
'video.avi.conf' with the file-specific options in it and put it in
``~/.mpv/``. You can also put the configuration file in the same directory
``~/.config/mpv/``. You can also put the configuration file in the same directory
as the file to be played, as long as you give the ``--use-filedir-conf``
option (either on the command line or in your global config file). If a
file-specific configuration file is found in the same directory, no
file-specific configuration is loaded from ``~/.mpv``. In addition, the
file-specific configuration is loaded from ``~/.config/mpv``. In addition, the
``--use-filedir-conf`` option enables directory-specific configuration files.
For this, mpv first tries to load a mpv.conf from the same directory
as the file played and then tries to load any file-specific configuration.
+14 -11
View File
@@ -255,9 +255,8 @@ Program Behavior
Print version string and exit.
``--no-config``
Do not load default configuration files. This prevents loading of
``~/.config/mpv/mpv.conf`` and ``~/.config/mpv/input.conf``, as well as
loading the same files from system wide configuration directories. Other
Do not load default configuration files. This prevents loading of both the
user-level and system-wide ``mpv.conf`` and ``input.conf`` files. Other
configuration files are blocked as well, such as resume playback files.
.. note::
@@ -313,7 +312,8 @@ Program Behavior
Specify configuration file to be parsed after the default ones.
``--load-scripts=<yes|no>``
If set to ``no``, don't auto-load scripts from ``~/.mpv/lua/``.
If set to ``no``, don't auto-load scripts from the ``lua`` configuration
subdirectory (usually ``~/.config/mpv/lua/``).
(Default: ``yes``)
``--lua=<filename>``
@@ -335,7 +335,8 @@ Program Behavior
commands.
``--no-resume-playback``
Do not restore playback position from ``~/.mpv/watch_later/``.
Do not restore playback position from the ``watch_later`` configuration
subdirectory (usually ``~/.config/mpv/watch_later/``).
See ``quit_watch_later`` input command.
``--profile=<profile1,profile2,...>``
@@ -1145,6 +1146,7 @@ Subtitles
:yes: Apply all the ``--ass-*`` style override options. Changing the default
for any of these options can lead to incorrect subtitle rendering
(default).
:signfs: like ``yes``, but apply ``--sub-scale`` only to signs
:no: Render subtitles as forced by subtitle scripts.
:force: Try to force the font style as defined by the ``--sub-text-*``
options. Requires a modified libass, can break rendering easily.
@@ -1362,7 +1364,7 @@ Subtitles
- ``/path/to/video/sub/``
- ``/path/to/video/subtitles/``
- ``/tmp/subs/``
- ``~/.mpv/sub/``
- the ``sub`` configuration subdirectory (usually ``~/.config/mpv/sub/``)
``--sub-visibility``, ``--no-sub-visibility``
Can be used to disable display of subtitles, but still select and decode
@@ -2081,8 +2083,8 @@ Input
Number of key presses to generate per second on autorepeat.
``--input-conf=<filename>``
Specify input configuration file other than the default
``~/.config/mpv/input.conf``.
Specify input configuration file other than the default location in the mpv
configuration directory (usually ``~/.config/mpv/input.conf``).
``--no-input-default-bindings``
Disable mpv default (built-in) key bindings.
@@ -2963,9 +2965,10 @@ DVB
Specifies using card number 1-4 (default: 1).
``--dvbin-file=<filename>``
Instructs mpv to read the channels list from ``<filename>``. Default is
``~/.mpv/channels.conf.{sat,ter,cbl,atsc}`` (based on your card type) or
``~/.mpv/channels.conf`` as a last resort.
Instructs mpv to read the channels list from ``<filename>``. The default is
in the mpv configuration directory (usually ``~/.config/mpv``) with the
filename ``channels.conf.{sat,ter,cbl,atsc}`` (based on your card type) or
``channels.conf`` as a last resort.
``--dvbin-timeout=<1-30>``
Maximum number of seconds to wait when trying to tune a frequency before
+1 -1
View File
@@ -161,7 +161,7 @@ To avoid collisions with other scripts, all options need to be prefixed with
Example::
--lua-opts=osc-optionA=value1:osc-optionB=value2
--lua-opts=osc-optionA=value1,osc-optionB=value2
Configurable Options
+126
View File
@@ -0,0 +1,126 @@
Release 0.6.2
=============
Changes
-------
- The --ass-style-override option now requires a newer version of libass.
Bug fixes
---------
- Correctly signal EOF when using --frames.
- Strictly endorce the limit imposed by --frames (i.e. avoid producing an extra
frame at the end).
- Fix \x-style escaping when parsing commands.
- Correctly handle ^h key on the terminal (this should fix the when inserted
fromBackspace key on new versions of xterm).
- Don't put the player to sleep after audio reinit.
- Properly exit if both audio and video fail to initialize.
This listing is not complete. There are many more bug fixes and changes. The
complete change log can be viewed by running ``git log a6eb071..0a40fb0`` in
the git repository.
Release 0.6.1
=============
Changes
-------
- Don't show message on "osd" command by default (this essentially reverts a
change introduced in the last release).
- Add an alternative input configuration that reverts the key binding changes
introduced by previous releases (see etc/restore-old-bindings.conf in the
sources).
- Automatically install example input configuration files.
Bug fixes
---------
- Make stream language work with Bluray as well (the previous release
introduced this for DVDs, but it didn't work for Blurays).
- Don't try to create surfaces of size 0 in the VDPAU vo.
- Don't print audio/video init failure message twice.
- Fix playback on the root window on X11 (i.e. when using --wid=0).
- Fix the autodetection of the input format in the vf_stereo3d filter when mpv
is built against libav (this makes --video-stereo-mode work with libav as
well).
- Fix compilation with PulseAudio 1.0.
- Fix compilation with clang.
- Try harder to decode cover art picture only once.
- Fix cursor autohide (--cursor-autohide) with audio-only files on file change
(e.g. when skipping to the next playlist file).
This listing is not complete. There are many more bug fixes and changes. The
complete change log can be viewed by running ``git log 061f509..2ffdc0d`` in
the git repository.
Release 0.6.0
=============
Changes
-------
- Map ESC to exiting fullscreen.
- Run the vo inside its own thread.
- Enable the demuxer thread by default.
- Prefer the opengl vo over the vdpau one.
- Complete profile names in the zsh completion script.
- Raise dsound ao buffer size to 200ms and make it configurable.
- Bind ctrl+c to quit, so that it works both in the terminal and the player
window.
- Automatically load playlists without needing --load-unsafe-playlists or
--playlist. Unsafe URLs are still rejected (e.g. remote playlists can't load
local files).
- Remove quvi-format property (which never really worked).
- Wait until all Lua scripts are loaded on start.
- Use separate threads for input sources (terminal, lirc, joystick) instead of
using a central I/O loop.
- Complete values for options that take file names in the zsh completion script.
- Use libwaio for pipe input on Windows (if you want --input-file to work on
Windows you need libwaio as an additional dependency).
- Remove the --volstep option (users should change the argument to the "add"
function in input.conf instead).
- Always show the OSD message when changing volume, gamma, panscan, etc along
with the OSD bar.
- When changing a property always show it on the OSD (except for "pause" and
"fullscreen").
- Prefer the libavcodec decoder over libmpg123 for mp3 decoding (ffmpeg/libav
support for gapless audio works better for mpv's use-case).
- Allow passing number of loops to --loop-file.
- Change --keep-open option semantics to not terminate the player when playing
or seeking past the end of the file and there's no next file to be played.
- Disable the sndio ao by default and prefer other outputs even if it's enabled.
New features
------------
- Add new framedrop mode that limits the frequency of new video frames displayed
based on the display framerate (this is enabled by default, the old
decoder-based mode can be enabled with --framedrop=decoder).
- Add --demuxer-readahead-secs option to control the readahead buffer using a
duration value.
- Add estimated-frame-count and estimated-frame-number properties.
- Add --cache-secs option which overrides the value of --demuxer-readahead-secs
if the stream cache is active.
- Add demuxer-cache-duration and demuxer-cache-idle properties.
- Make --cache-file create a temporary file if the string "TMP" is passed
instead of a file name.
- Add support for Matroska 3D (if a file is marked as 3D using the StereoMode
element, an automatic conversion filter is added).
- Add --osd-playing-msg option to show a message on the OSD when the playback
starts.
- Add --media-title option to force the content of the media-title property.
- Add --osd-msg1, --osd-msg2 and --osd-msg3 options to override the OSD message
for the corresponding OSD level (before only level 3 could be overridden with
--osd-status-message).
- Add support for digital passthrough in the pulse ao.
- Add support for opening DVD and Bluray directories directly.
- Add --input-x11-keyboard option to control whether keyboard input should be
enabled on the X11 window ot not (this is disabled by default when using the
libmpv library).
This listing is not complete. There are many more bug fixes and changes. The
complete change log can be viewed by running ``git log a1be3cf..61ebe61`` in
the git repository.
+1
View File
@@ -0,0 +1 @@
0.6.2
+2 -2
View File
@@ -232,8 +232,8 @@ static int filter(struct af_instance* af, struct mp_audio* audio, int flags)
AV_WL16(hdr, 0xF872); // iec 61937 syncword 1
AV_WL16(hdr + 2, 0x4E1F); // iec 61937 syncword 2
hdr[4] = bsmod; // bsmod
hdr[5] = 0x01; // data-type ac3
hdr[5] = bsmod; // bsmod
hdr[4] = 0x01; // data-type ac3
AV_WL16(hdr + 6, len << 3); // number of bits in payload
}
+9 -9
View File
@@ -381,20 +381,15 @@ static int init(struct ao *ao)
pa_proplist_free(proplist);
proplist = NULL;
pa_sample_spec ss;
pa_channel_map map2;
if (pa_format_info_to_sample_spec(format, &ss, &map2) < 0)
goto unlock_and_fail;
pa_stream_set_state_callback(priv->stream, stream_state_cb, ao);
pa_stream_set_write_callback(priv->stream, stream_request_cb, ao);
pa_stream_set_latency_update_callback(priv->stream,
stream_latency_update_cb, ao);
int buf_size = af_fmt_seconds_to_bytes(ao->format, priv->cfg_buffer / 1000.0,
ao->channels.num, ao->samplerate);
pa_buffer_attr bufattr = {
.maxlength = -1,
.tlength = priv->cfg_buffer > 0 ?
pa_usec_to_bytes(priv->cfg_buffer * 1000, &ss) : (uint32_t)-1,
.tlength = buf_size > 0 ? buf_size : (uint32_t)-1,
.prebuf = -1,
.minreq = -1,
.fragsize = -1,
@@ -418,6 +413,11 @@ static int init(struct ao *ao)
pa_threaded_mainloop_wait(priv->mainloop);
}
if (pa_stream_is_suspended(priv->stream)) {
MP_ERR(ao, "The stream is suspended. Bailing out.\n");
goto unlock_and_fail;
}
pa_threaded_mainloop_unlock(priv->mainloop);
return 0;
@@ -728,7 +728,7 @@ const struct ao_driver audio_out_pulse = {
.options = (const struct m_option[]) {
OPT_STRING("host", cfg_host, 0),
OPT_STRING("sink", cfg_sink, 0),
OPT_CHOICE_OR_INT("buffer", cfg_buffer, 0, 1, 2000, ({"native", -1})),
OPT_CHOICE_OR_INT("buffer", cfg_buffer, 0, 1, 2000, ({"native", 0})),
OPT_FLAG("latency-hacks", cfg_latency_hacks, 0),
{0}
},
-5
View File
@@ -25,11 +25,6 @@
#include "audio/chmap.h"
#include "audio/chmap_sel.h"
// If ao_get_delay() reaches this value after ao_play() was called with the
// AOPLAY_FINAL_CHUNK flag set, the playback core expects that the audio has
// all been played.
#define AO_EOF_DELAY 0.05
/* global data used by ao.c and ao drivers */
struct ao {
int samplerate;
+31 -38
View File
@@ -44,14 +44,12 @@ struct ao_push_state {
pthread_t thread;
pthread_mutex_t lock;
pthread_cond_t wakeup;
pthread_cond_t wakeup_drain;
// --- protected by lock
struct mp_audio_buffer *buffer;
bool terminate;
bool drain;
bool wait_on_ao;
bool still_playing;
bool need_wakeup;
@@ -92,15 +90,7 @@ static double unlocked_get_delay(struct ao *ao)
double driver_delay = 0;
if (ao->driver->get_delay)
driver_delay = ao->driver->get_delay(ao);
double delay = driver_delay + mp_audio_buffer_seconds(p->buffer);
if (delay >= AO_EOF_DELAY && p->expected_end_time) {
if (mp_time_sec() > p->expected_end_time) {
MP_ERR(ao, "Audio device EOF reporting is broken!\n");
MP_ERR(ao, "Please report this problem.\n");
delay = 0;
}
}
return delay;
return driver_delay + mp_audio_buffer_seconds(p->buffer);
}
static float get_delay(struct ao *ao)
@@ -153,20 +143,27 @@ static void drain(struct ao *ao)
{
struct ao_push_state *p = ao->api_priv;
MP_VERBOSE(ao, "draining...\n");
pthread_mutex_lock(&p->lock);
if (p->paused) {
pthread_mutex_unlock(&p->lock);
return;
}
if (p->paused)
goto done;
p->final_chunk = true;
p->drain = true;
wakeup_playthread(ao);
while (p->drain)
pthread_cond_wait(&p->wakeup_drain, &p->lock);
while (p->still_playing && mp_audio_buffer_samples(p->buffer) > 0)
pthread_cond_wait(&p->wakeup, &p->lock);
if (ao->driver->drain) {
ao->driver->drain(ao);
} else {
double time = unlocked_get_delay(ao);
mp_sleep_us(MPMIN(time, ao->buffer / (double)ao->samplerate + 1) * 1e6);
}
done:
pthread_mutex_unlock(&p->lock);
if (!ao->driver->drain)
mp_sleep_us(get_delay(ao) * 1000000);
reset(ao);
}
@@ -235,7 +232,6 @@ static int play(struct ao *ao, void **data, int samples, int flags)
bool got_data = write_samples > 0 || p->paused || p->final_chunk != is_final;
p->expected_end_time = 0;
p->final_chunk = is_final;
p->paused = false;
p->still_playing |= write_samples > 0;
@@ -279,11 +275,8 @@ static void ao_play_data(struct ao *ao)
r = max;
}
mp_audio_buffer_skip(p->buffer, r);
if (p->final_chunk && mp_audio_buffer_samples(p->buffer) == 0) {
p->expected_end_time = mp_time_sec() + AO_EOF_DELAY + 0.25; // + margin
if (ao->driver->get_delay)
p->expected_end_time += ao->driver->get_delay(ao);
}
if (r > 0)
p->expected_end_time = 0;
// Nothing written, but more input data than space - this must mean the
// AO's get_space() doesn't do period alignment correctly.
bool stuck = r == 0 && max >= space && space > 0;
@@ -312,13 +305,6 @@ static void *playthread(void *arg)
if (!p->paused)
ao_play_data(ao);
if (p->drain && (!p->wait_on_ao || p->paused)) {
if (ao->driver->drain)
ao->driver->drain(ao);
p->drain = false;
pthread_cond_signal(&p->wakeup_drain);
}
if (!p->need_wakeup) {
MP_STATS(ao, "start audio wait");
if (!p->wait_on_ao || p->paused) {
@@ -332,14 +318,22 @@ static void *playthread(void *arg)
bool was_playing = p->still_playing;
double timeout = -1;
if (p->still_playing && !p->paused) {
timeout = unlocked_get_delay(ao);
if (timeout < AO_EOF_DELAY)
if (p->still_playing && !p->paused && p->final_chunk &&
!mp_audio_buffer_samples(p->buffer))
{
double now = mp_time_sec();
if (!p->expected_end_time)
p->expected_end_time = now + unlocked_get_delay(ao);
if (p->expected_end_time < now) {
p->still_playing = false;
} else {
timeout = p->expected_end_time - now;
}
}
if (was_playing && !p->still_playing)
mp_input_wakeup(ao->input_ctx);
pthread_cond_signal(&p->wakeup); // for draining
if (p->still_playing && timeout > 0) {
mpthread_cond_timedwait_rel(&p->wakeup, &p->lock, timeout);
@@ -347,6 +341,7 @@ static void *playthread(void *arg)
pthread_cond_wait(&p->wakeup, &p->lock);
}
} else {
// Wait until the device wants us to write more data to it.
if (!ao->driver->wait || ao->driver->wait(ao, &p->lock) < 0) {
// Fallback to guessing.
double timeout = 0;
@@ -374,7 +369,6 @@ static void destroy_no_thread(struct ao *ao)
close(p->wakeup_pipe[n]);
pthread_cond_destroy(&p->wakeup);
pthread_cond_destroy(&p->wakeup_drain);
pthread_mutex_destroy(&p->lock);
}
@@ -398,7 +392,6 @@ static int init(struct ao *ao)
pthread_mutex_init(&p->lock, NULL);
pthread_cond_init(&p->wakeup, NULL);
pthread_cond_init(&p->wakeup_drain, NULL);
mp_make_wakeup_pipe(p->wakeup_pipe);
if (ao->device_buffer <= 0) {
+1 -1
View File
@@ -171,7 +171,7 @@ static bool mp_parse_escape(void *talloc_ctx, bstr *dst, bstr *code)
if (code->start[0] == 'x' && code->len >= 3) {
bstr num = bstr_splice(*code, 1, 3);
char c = bstrtoll(num, &num, 16);
if (!num.len)
if (num.len)
return false;
bstr_xappend(talloc_ctx, dst, (bstr){&c, 1});
*code = bstr_cut(*code, 3);
+1
View File
@@ -143,6 +143,7 @@ static void add_streams(demuxer_t *demuxer)
sh->codec = talloc_strdup(sh, src->codec);
sh->format = src->format;
sh->lav_headers = src->lav_headers;
sh->demuxer_id = src->demuxer_id;
if (src->video) {
double ar;
if (stream_control(demuxer->stream, STREAM_CTRL_GET_ASPECT_RATIO, &ar)
+1
View File
@@ -131,6 +131,7 @@ static const char *const format_blacklist[] = {
// Image demuxers, disabled in favor of demux_mf:
"image2", "image2pipe",
"bmp_pipe", "dpx_pipe", "exr_pipe", "j2k_pipe", "png_pipe", "tiff_pipe",
"jpeg_pipe",
0
};
+1 -1
View File
@@ -1149,7 +1149,7 @@ static const videocodec_info_t vinfo[] = {
static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track)
{
unsigned char *extradata;
unsigned char *extradata = NULL;
unsigned int extradata_size = 0;
bool raw = false;
struct sh_stream *sh = new_sh_stream(demuxer, STREAM_VIDEO);
+1 -1
View File
@@ -28,7 +28,7 @@ ENTER playlist_next force # skip to next file
p cycle pause
. frame_step # advance one frame and pause
SPACE cycle pause
HOME set playlist-pos 1 # not the same as MPlayer
HOME set playlist-pos 0 # not the same as MPlayer
#END pt_up_step -1
> playlist_next # skip to next file
< playlist_prev # previous
+31
View File
@@ -0,0 +1,31 @@
# This file contains all bindings that were removed after a certain release.
# If you want MPlayer bindings, use mplayer-input.conf
# Pick the bindings you want back and add them to your own input.conf. Append
# this file to your input.conf if you want them all back:
#
# cat restore-old-bindings.conf >> ~/.config/mpv/input.conf
#
# Older installations use ~/.mpv/input.conf instead.
# changed in mpv 0.6.0
ESC quit
# changed in mpv 0.5.0
PGUP seek 600
PGDWN seek -600
RIGHT seek 10
LEFT seek -10
+ add audio-delay 0.100
- add audio-delay -0.100
( add balance -0.1
) add balance 0.1
F cycle sub-forced-only
TAB cycle program
A cycle angle
U stop
o osd
I show_text "${filename}"
+1 -1
View File
@@ -332,7 +332,7 @@ const m_option_t mp_opts[] = {
OPT_CHOICE("ass-shaper", ass_shaper, 0,
({"simple", 0}, {"complex", 1})),
OPT_CHOICE("ass-style-override", ass_style_override, 0,
({"no", 0}, {"yes", 1}, {"force", 3})),
({"no", 0}, {"yes", 1}, {"force", 3}, {"signfs", 4})),
OPT_FLAG("sub-scale-with-window", sub_scale_with_window, 0),
OPT_FLAG("osd-bar", osd_bar_visible, 0),
OPT_FLOATRANGE("osd-bar-align-x", osd_bar_align_x, 0, -1.0, +1.0),
+1
View File
@@ -70,6 +70,7 @@ struct key_entry {
};
static const struct key_entry keys[] = {
{"\010", MP_KEY_BS},
{"\011", MP_KEY_TAB},
{"\012", MP_KEY_ENTER},
{"\177", MP_KEY_BS},
+5 -4
View File
@@ -214,8 +214,8 @@ void reinit_audio_chain(struct MPContext *mpctx)
init_error:
uninit_player(mpctx, INITIALIZED_ACODEC | INITIALIZED_AO);
no_audio:
mp_deselect_track(mpctx, track);
MP_INFO(mpctx, "Audio: no audio\n");
if (track)
error_on_track(mpctx, track);
}
// Return pts value corresponding to the end point of audio written to the
@@ -381,6 +381,7 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
return;
}
reinit_audio_chain(mpctx);
mpctx->sleeptime = 0;
return; // try again next iteration
}
@@ -519,8 +520,8 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
// Drop data queued for output, or which the AO is currently outputting.
void clear_audio_output_buffers(struct MPContext *mpctx)
{
if (mpctx->ao) {
if (mpctx->ao)
ao_reset(mpctx->ao);
if (mpctx->ao_buffer)
mp_audio_buffer_clear(mpctx->ao_buffer);
}
}
+3 -4
View File
@@ -3024,7 +3024,7 @@ static const struct property_osd_display {
{ "clock", "Clock" },
// audio
{ "volume", "Volume",
.msg = "Volume: ${volume}% ${?mute==yes:(Muted)}",
.msg = "Volume: ${?volume:${volume}% ${?mute==yes:(Muted)}}${!volume:${volume}}",
.osd_progbar = OSD_VOLUME },
{ "mute", "Mute" },
{ "audio-delay", "A-V delay" },
@@ -3695,11 +3695,10 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
opts->osd_level = (opts->osd_level + 1) % (MAX_OSD_LEVEL + 1);
else
opts->osd_level = MPCLAMP(v, 0, MAX_OSD_LEVEL);
if (opts->osd_level > 0) {
if (opts->osd_level > 0 && (on_osd & MP_ON_OSD_MSG))
set_osd_msg(mpctx, osdl, osd_duration, "OSD level: %d", opts->osd_level);
} else {
if (opts->osd_level == 0)
set_osd_msg(mpctx, 0, 0, "");
}
break;
}
+2
View File
@@ -266,6 +266,8 @@ void mp_get_resume_defaults(struct MPContext *mpctx)
// Should follow what parser-cfg.c does/needs
static bool needs_config_quoting(const char *s)
{
if (s[0] == '%')
return true;
for (int i = 0; s && s[i]; i++) {
unsigned char c = s[i];
if (!mp_isprint(c) || mp_isspace(c) || c == '#' || c == '\'' || c == '"')
+1
View File
@@ -425,6 +425,7 @@ void merge_playlist_files(struct playlist *pl);
float mp_get_cache_percent(struct MPContext *mpctx);
bool mp_get_cache_idle(struct MPContext *mpctx);
void update_window_title(struct MPContext *mpctx, bool force);
void error_on_track(struct MPContext *mpctx, struct track *track);
void stream_dump(struct MPContext *mpctx);
// osd.c
+18
View File
@@ -175,6 +175,24 @@ void update_window_title(struct MPContext *mpctx, bool force)
}
}
void error_on_track(struct MPContext *mpctx, struct track *track)
{
if (!track)
return;
mp_deselect_track(mpctx, track);
if (track) {
if (track->type == STREAM_AUDIO)
MP_INFO(mpctx, "Audio: no audio\n");
if (track->type == STREAM_VIDEO)
MP_INFO(mpctx, "Video: no video\n");
if (!mpctx->current_track[0][STREAM_AUDIO] &&
!mpctx->current_track[0][STREAM_VIDEO])
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->error_playing = true;
mpctx->sleeptime = 0;
}
}
void stream_dump(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
+7 -4
View File
@@ -531,9 +531,12 @@ static void handle_osd_redraw(struct MPContext *mpctx)
return;
}
// Don't redraw immediately during a seek (makes it significantly slower).
if (mpctx->d_video && mp_time_sec() - mpctx->start_timestamp < 0.1)
if (mpctx->d_video && mp_time_sec() - mpctx->start_timestamp < 0.1) {
mpctx->sleeptime = MPMIN(mpctx->sleeptime, 0.1);
return;
bool want_redraw = osd_query_and_reset_want_redraw(mpctx->osd);
}
bool want_redraw = osd_query_and_reset_want_redraw(mpctx->osd) ||
vo_want_redraw(mpctx->video_out);
if (!want_redraw)
return;
vo_redraw(mpctx->video_out);
@@ -745,7 +748,7 @@ static void handle_sstep(struct MPContext *mpctx)
if (mpctx->video_status >= STATUS_EOF) {
if (mpctx->max_frames >= 0)
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->stop_play = AT_END_OF_FILE; // force EOF even if audio left
if (mpctx->step_frames > 0 && !mpctx->paused)
pause_player(mpctx);
}
@@ -817,7 +820,6 @@ void handle_force_window(struct MPContext *mpctx, bool reconfig)
.d_w = w, .d_h = h,
};
vo_reconfig(vo, &p, 0);
vo_control(vo, VOCTRL_SET_CURSOR_VISIBILITY, &(bool){true});
vo_control(vo, VOCTRL_RESTORE_SCREENSAVER, NULL);
vo_set_paused(vo, true);
vo_redraw(vo);
@@ -986,6 +988,7 @@ void idle_loop(struct MPContext *mpctx)
mp_wait_events(mpctx, mpctx->sleeptime);
mpctx->sleeptime = 100.0;
mp_process_input(mpctx);
handle_cursor_autohide(mpctx);
update_osd_msg(mpctx);
handle_osd_redraw(mpctx);
}
+14 -9
View File
@@ -55,6 +55,7 @@ enum {
VD_PROGRESS = 1, // progress, but no output; repeat call with no waiting
VD_NEW_FRAME = 2, // the call produced a new frame
VD_WAIT = 3, // no EOF, but no output; wait until wakeup
VD_RECONFIG = 4,
};
static const char av_desync_help_text[] =
@@ -308,9 +309,9 @@ int reinit_video_chain(struct MPContext *mpctx)
err_out:
no_video:
uninit_player(mpctx, INITIALIZED_VCODEC | (opts->force_vo ? 0 : INITIALIZED_VO));
mp_deselect_track(mpctx, track);
if (track)
error_on_track(mpctx, track);
handle_force_window(mpctx, true);
MP_INFO(mpctx, "Video: no video\n");
return 0;
}
@@ -433,7 +434,7 @@ static int video_filter(struct MPContext *mpctx, bool eof)
if (vf->initialized < 1)
return VD_ERROR;
init_filter_params(mpctx);
return VD_PROGRESS;
return VD_RECONFIG;
}
// If something was decoded, and the filter chain is ready, filter it.
@@ -468,7 +469,10 @@ static int video_decode_and_filter(struct MPContext *mpctx)
}
bool eof = !d_video->waiting_decoded_mpi && (r == VD_EOF || r < 0);
return video_filter(mpctx, eof);
r = video_filter(mpctx, eof);
if (r == VD_RECONFIG) // retry feeding decoded image
r = video_filter(mpctx, eof);
return r;
}
/* Modify video timing to match the audio timeline. There are two main
@@ -520,6 +524,7 @@ static int video_output_image(struct MPContext *mpctx, double endpts)
if (mpctx->next_frame[0])
return VD_NEW_FRAME;
int r = video_decode_and_filter(mpctx);
video_filter(mpctx, true); // force EOF filtering (avoid decoding more)
mpctx->next_frame[0] = vf_read_output_frame(mpctx->d_video->vfilter);
if (mpctx->next_frame[0])
mpctx->next_frame[0]->pts = MP_NOPTS_VALUE;
@@ -574,7 +579,9 @@ static int video_output_image(struct MPContext *mpctx, double endpts)
&& mpctx->video_status == STATUS_SYNCING;
if (hrseek && img->pts < mpctx->hrseek_pts - .005)
drop = true;
if (endpts != MP_NOPTS_VALUE && img->pts >= endpts) {
if ((endpts != MP_NOPTS_VALUE && img->pts >= endpts) ||
mpctx->max_frames == 0)
{
drop = true;
r = VD_EOF;
}
@@ -801,7 +808,7 @@ void write_video(struct MPContext *mpctx, double endpts)
pause_player(mpctx);
}
if (mpctx->max_frames == 0)
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->stop_play = AT_END_OF_FILE;
if (mpctx->max_frames > 0)
mpctx->max_frames--;
}
@@ -815,9 +822,7 @@ error:
if (!opts->force_vo)
uninit |= INITIALIZED_VO;
uninit_player(mpctx, uninit);
if (!mpctx->current_track[STREAM_AUDIO])
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->error_playing = true;
error_on_track(mpctx, mpctx->current_track[STREAM_VIDEO][0]);
handle_force_window(mpctx, true);
mpctx->sleeptime = 0;
}
+7 -4
View File
@@ -136,13 +136,11 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts,
float set_line_spacing = 0;
float set_font_scale = 1;
int set_hinting = 0;
int set_force_override = 0;
if (opts->ass_style_override) {
set_use_margins = opts->ass_use_margins;
set_sub_pos = 100 - opts->sub_pos;
set_line_spacing = opts->ass_line_spacing;
set_hinting = opts->ass_hinting;
set_force_override = opts->ass_style_override == 3;
set_font_scale = opts->sub_scale;
if (opts->sub_scale_with_window) {
int vidh = dim->h - (dim->mt + dim->mb);
@@ -157,8 +155,13 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts,
#if LIBASS_VERSION >= 0x01000000
ass_set_shaper(priv, opts->ass_shaper);
#endif
#if LIBASS_VERSION >= 0x01103000
ass_set_selective_style_override_enabled(priv, set_force_override);
#if LIBASS_VERSION >= 0x01103001
int set_force_flags = 0;
if (opts->ass_style_override == 3)
set_force_flags |= ASS_OVERRIDE_BIT_STYLE | ASS_OVERRIDE_BIT_FONT_SIZE;
if (opts->ass_style_override == 4)
set_force_flags |= ASS_OVERRIDE_BIT_FONT_SIZE;
ass_set_selective_style_override_enabled(priv, set_force_flags);
ASS_Style style = {0};
mp_ass_set_style(&style, 288, opts->sub_text_style);
ass_set_selective_style_override(priv, &style);
-1
View File
@@ -40,7 +40,6 @@ static void vf_lw_set_reconfig_cb(struct vf_instance *vf,
struct mp_image_params *in,
struct mp_image_params *out))
{
return 0;
}
#include "options/m_option.h"
static const struct m_sub_options vf_lw_conf = {0};
+1 -1
View File
@@ -542,7 +542,7 @@ static int vf_open(vf_instance_t *vf)
vf->priv->auto_in = 1;
if (vf->priv->in.fmt == STEREO_AUTO &&
vf_lw_set_graph(vf, vf->priv->lw_opts, NULL, "null") >= 0)
vf_lw_set_graph(vf, vf->priv->lw_opts, "stereo3d", "null") >= 0)
{
vf_lw_set_reconfig_cb(vf, lavfi_reconfig);
return 1;
+5 -3
View File
@@ -193,9 +193,11 @@ static bool config_window_x11(struct MPGLContext *ctx, int flags)
int glx_major, glx_minor;
// FBConfigs were added in GLX version 1.3.
if (!glXQueryVersion(vo->x11->display, &glx_major, &glx_minor) ||
(MPGL_VER(glx_major, glx_minor) < MPGL_VER(1, 3)))
{
if (!glXQueryVersion(vo->x11->display, &glx_major, &glx_minor)) {
MP_ERR(vo, "GLX not found.\n");
return false;
}
if (MPGL_VER(glx_major, glx_minor) < MPGL_VER(1, 3)) {
MP_ERR(vo, "GLX version older than 1.3.\n");
return false;
}
+19 -3
View File
@@ -125,7 +125,8 @@ struct vo_internal {
bool hasframe;
bool hasframe_rendered;
bool request_redraw;
bool request_redraw; // redraw request from player to VO
bool want_redraw; // redraw request from VO to player
bool paused;
int64_t flip_queue_offset; // queue flip events at most this much in advance
@@ -615,6 +616,7 @@ static bool render_frame(struct vo *vo)
vo->want_redraw = false;
in->want_redraw = false;
in->request_redraw = false;
in->rendering = false;
@@ -634,6 +636,7 @@ static void do_redraw(struct vo *vo)
pthread_mutex_lock(&in->lock);
in->request_redraw = false;
in->want_redraw = false;
bool skip = !in->paused && in->dropped_frame;
struct mp_image *img = in->dropped_image;
if (!skip) {
@@ -685,9 +688,13 @@ static void *vo_thread(void *ptr)
mp_input_wakeup(vo->input_ctx);
}
}
vo->want_redraw |= in->request_redraw;
if (vo->want_redraw && !in->want_redraw) {
in->want_redraw = true;
mp_input_wakeup(vo->input_ctx);
}
bool redraw = in->request_redraw;
pthread_mutex_unlock(&in->lock);
if (wait_until > now && vo->want_redraw) {
if (wait_until > now && redraw) {
do_redraw(vo); // now is a good time
continue;
}
@@ -731,6 +738,15 @@ void vo_redraw(struct vo *vo)
pthread_mutex_unlock(&in->lock);
}
bool vo_want_redraw(struct vo *vo)
{
struct vo_internal *in = vo->in;
pthread_mutex_lock(&in->lock);
bool r = in->want_redraw;
pthread_mutex_unlock(&in->lock);
return r;
}
void vo_seek_reset(struct vo *vo)
{
pthread_mutex_lock(&vo->in->lock);
+1
View File
@@ -292,6 +292,7 @@ void vo_wait_frame(struct vo *vo);
bool vo_still_displaying(struct vo *vo);
bool vo_has_frame(struct vo *vo);
void vo_redraw(struct vo *vo);
bool vo_want_redraw(struct vo *vo);
void vo_seek_reset(struct vo *vo);
void vo_destroy(struct vo *vo);
void vo_set_paused(struct vo *vo, bool paused);
+9 -10
View File
@@ -234,6 +234,13 @@ static void forget_frames(struct vo *vo, bool seek_reset)
vc->dropped_frame = false;
}
static int s_size(int s, int disp)
{
disp = MPMAX(1, disp);
s += s / 2;
return s >= disp ? s : disp;
}
static void resize(struct vo *vo)
{
struct vdpctx *vc = vo->priv;
@@ -259,16 +266,8 @@ static void resize(struct vo *vo)
if (vc->output_surface_width < vo->dwidth
|| vc->output_surface_height < vo->dheight) {
if (vc->output_surface_width < vo->dwidth) {
vc->output_surface_width += vc->output_surface_width >> 1;
vc->output_surface_width = FFMAX(vc->output_surface_width,
vo->dwidth);
}
if (vc->output_surface_height < vo->dheight) {
vc->output_surface_height += vc->output_surface_height >> 1;
vc->output_surface_height = FFMAX(vc->output_surface_height,
vo->dheight);
}
vc->output_surface_width = s_size(vc->output_surface_width, vo->dwidth);
vc->output_surface_height = s_size(vc->output_surface_height, vo->dheight);
// Creation of output_surfaces
for (int i = 0; i < vc->num_output_surfaces; i++)
if (vc->output_surfaces[i] != VDP_INVALID_HANDLE) {
+3 -1
View File
@@ -1328,6 +1328,7 @@ void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int flags,
if (opts->WinID >= 0) {
if (opts->WinID == 0) {
x11->window = x11->rootwin;
x11->pseudo_mapped = true;
XSelectInput(x11->display, x11->window, StructureNotifyMask);
} else {
XSelectInput(x11->display, opts->WinID, StructureNotifyMask);
@@ -1339,6 +1340,7 @@ void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int flags,
vo_x11_create_window(vo, vis, rc);
vo_x11_classhint(vo, x11->window, classname);
x11->window_hidden = true;
x11->winrc = geo.win;
}
if (flags & VOFLAG_HIDDEN)
@@ -1453,7 +1455,7 @@ static void vo_x11_update_geometry(struct vo *vo)
int dummy_int;
Window dummy_win;
Window win = vo->opts->WinID > 0 ? vo->opts->WinID : x11->window;
if (x11->window_hidden || !win)
if (!win)
return;
XGetGeometry(x11->display, win, &dummy_win, &dummy_int, &dummy_int,
&w, &h, &dummy_int, &dummy_uint);
+5
View File
@@ -447,6 +447,11 @@ def build(ctx):
install_path = ctx.env.BINDIR,
**cprog_kwargs
)
for f in ['example.conf', 'input.conf', 'mplayer-input.conf', \
'restore-old-bindings.conf']:
import os
ctx.install_as(os.path.join(ctx.env.DOCDIR, f),
os.path.join('etc/', f))
build_shared = ctx.dependency_satisfied('libmpv-shared')
build_static = ctx.dependency_satisfied('libmpv-static')