Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d9f8f75ea | ||
|
|
2ffdc0da13 | ||
|
|
7ae6484cd4 | ||
|
|
08d144138b | ||
|
|
58b511d947 | ||
|
|
9b8b2933f3 | ||
|
|
24c05b2a82 | ||
|
|
1412b0171d | ||
|
|
5c1c99b858 | ||
|
|
f66e320d7b | ||
|
|
fa2381765e | ||
|
|
f220617267 | ||
|
|
381843eb88 | ||
|
|
9258d0461e | ||
|
|
e2f59fcabd | ||
|
|
5b76ce3865 | ||
|
|
1b29964a3e | ||
|
|
180fed4bc4 | ||
|
|
fb3bf1ae81 | ||
|
|
f842b3f2b2 | ||
|
|
e4f6235a47 | ||
|
|
89df07aa6d | ||
|
|
04a8dd38d5 | ||
|
|
72e881b60d | ||
|
|
45b99d9799 | ||
|
|
b784083fb5 | ||
|
|
d7cf596e2a | ||
|
|
a2e38ca657 | ||
|
|
3e410f423d | ||
|
|
061f509757 | ||
|
|
03bfc2b3fd |
No files matched your search
@@ -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
|
||||
|
||||
+3
-5
@@ -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.
|
||||
|
||||
|
||||
+13
-11
@@ -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
@@ -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.
|
||||
|
||||
+13
-11
@@ -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,...>``
|
||||
@@ -1362,7 +1363,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 +2082,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 +2964,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
@@ -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
|
||||
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
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.
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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}
|
||||
},
|
||||
|
||||
@@ -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
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}"
|
||||
+2
-1
@@ -215,7 +215,8 @@ 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)
|
||||
MP_INFO(mpctx, "Audio: no audio\n");
|
||||
}
|
||||
|
||||
// Return pts value corresponding to the end point of audio written to the
|
||||
|
||||
+3
-4
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+6
-3
@@ -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);
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+9
-4
@@ -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)
|
||||
mp_deselect_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;
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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
@@ -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
@@ -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);
|
||||
|
||||
@@ -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
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in new issue
Block a user