Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kwerner72/mpv
Browse files Browse the repository at this point in the history
  • Loading branch information
etecture-kwerner committed Aug 25, 2023
2 parents ce99232 + 406f77f commit bb02f35
Show file tree
Hide file tree
Showing 76 changed files with 1,243 additions and 880 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ jobs:
run: |
cat ./build/meson-logs/meson-log.txt
- name: Functional test
id: tests
run: |
cd artifact && wine64 ./mpv.com -v --no-config
env:
WINEDEBUG: '+loaddll'

- uses: actions/upload-artifact@v3
with:
name: mpv-${{ matrix.target }}
Expand Down Expand Up @@ -158,6 +165,11 @@ jobs:
copyback: false
usesh: true
prepare: |
# Update to latest release channel
mkdir -p /usr/local/etc/pkg/repos
echo "FreeBSD: { url: "pkg+http://pkg.freebsd.org/\${ABI}/latest" }" \
> /usr/local/etc/pkg/repos/FreeBSD.conf
pkg update
# Requested in ci/build-freebsd.sh
pkg install -y \
cmake \
Expand Down
14 changes: 7 additions & 7 deletions Copyright
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mpv as a whole is licensed under the GNU General Public License GPL version 2
or later (called GPLv2+ in this document, see LICENSE.GPL for full license
text) by default, or the GNU Lesser General Public License LGPL version 2 or
later (LGPLv2.1+ in this document, see LICENSE.LGPL for full license text) if
built with the --enable-lgpl configure switch.
built with the -Dgpl=false configure switch.

Most source files are LGPLv2.1+ or GPLv2+, but some files are available under
more liberal licenses, such as BSD, MIT, ISC, and possibly others. Look at the
Expand All @@ -31,11 +31,11 @@ contains the complete SVN and CVS history as well.
Some libraries are GPLv2+ or GPLv3+ only. Building mpv with Samba support makes
it GPLv3+.

mpv can be built as LGPLv2.1+ with the --enable-lgpl configure option. To add
a LGPL mode to mpv, MPlayer code had to be relicensed from GPLv2+ to LGPLv2.1+
by asking the MPlayer authors for permission. Since permission could not be
obtained from everyone, LGPL mode disables the following features, some of
them quite central:
mpv can be built as LGPLv2.1+ with the -Dgpl=false configure option. To add a
LGPL mode to mpv, MPlayer code had to be relicensed from GPLv2+ to LGPLv2.1+ by
asking the MPlayer authors for permission. Since permission could not be
obtained from everyone, LGPL mode disables the following features, some of them
quite central:
- Linux X11 video output
- BSD audio output via OSS
- NVIDIA/Linux hardware decoding (vdpau, although nvdec usually works)
Expand All @@ -45,7 +45,7 @@ Some of these will be fixed in the future. The intended use for LGPL mode is
with libmpv, and currently it's not recommended to build mpv CLI in LGPL mode
at all.

The following files are still GPL only (--enable-lgpl disables them):
The following files are still GPL only (-Dgpl=false disables them):

audio/out/ao_jack.c will stay GPL
audio/out/ao_oss.c will stay GPL
Expand Down
11 changes: 11 additions & 0 deletions DOCS/interface-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ Interface changes
in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows.
- change `--subs-with-matching-audio` default from `no` to `yes`
- change `--subs-fallback` default from `no` to `default`
- add the `--hdr-peak-percentile` option
- include `--hdr-peak-percentile` in the `gpu-hq` profile
- change `--audiotrack-pcm-float` default from `no` to `yes`
- add video-params/aspect-name
- change type of `--sub-pos` to float
- The remaining time printed in the terminal is now adjusted for speed by default.
You can disable this with `--no-term-remaining-playtime`.
- add `playlist-path` and `playlist/N/playlist-path` properties
- add `--x11-wid-title` option
- add `--libplacebo-opts` option
- change `--video-pan-x/y` to be relative to the destination rectangle
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.
Expand Down
14 changes: 14 additions & 0 deletions DOCS/man/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,10 @@ Property list
``video-params/aspect``
Display aspect ratio as float.

``video-params/aspect-name``
Display aspect ratio name as string. The name coresponds to motion
picture film format that introduced given aspect ratio in film.

``video-params/par``
Pixel aspect ratio.

Expand Down Expand Up @@ -2772,6 +2776,11 @@ Property list
``playlist-count``
Number of total playlist entries.

``playlist-path``
The original path of the playlist for the current entry before mpv expanded
the entries. Unavailable if the file was not originally associated with a
playlist in some way.

``playlist``
Playlist, current entry marked. Currently, the raw property value is
useless.
Expand Down Expand Up @@ -2805,6 +2814,11 @@ Property list
instance. Other commands, events, etc. use this as ``playlist_entry_id``
fields.

``playlist/N/playlist-path``
The original path of the playlist for this entry before mpv expanded
it. Unavailable if the file was not originally associated with a playlist
in some way.

When querying the property with the client API using ``MPV_FORMAT_NODE``,
or with Lua ``mp.get_property_native``, this will return a mpv_node with
the following contents:
Expand Down
2 changes: 2 additions & 0 deletions DOCS/man/mpv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ STOP
PREVIOUS and NEXT
Seek backward/forward 1 minute.

ZOOMIN and ZOOMOUT
Changes video zoom.

If you miss some older key bindings, look at ``etc/restore-old-bindings.conf``
in the mpv git repository.
Expand Down
41 changes: 32 additions & 9 deletions DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ Program Behavior
paths should be separated by : on Unix and ; on Windows. mpv looks in
order for the configured paths in PATH and in mpv's config directory.
The defaults are "yt-dlp", "yt-dlp_x86" and "youtube-dl". On Windows
the suffix extension ".exe" is always appended.
the suffix extension is not necessary, but only ".exe" is acceptable.

.. admonition:: Why do the option names mix ``_`` and ``-``?

Expand Down Expand Up @@ -1539,13 +1539,11 @@ Video

``--video-pan-x=<value>``, ``--video-pan-y=<value>``
Moves the displayed video rectangle by the given value in the X or Y
direction. The unit is in fractions of the size of the scaled video (the
full size, even if parts of the video are not visible due to panscan or
other options).
direction. The unit is in fractions of the size of the destination rectangle.

For example, displaying a 1280x720 video fullscreen on a 1680x1050 screen
with ``--video-pan-x=-0.1`` would move the video 168 pixels to the left
(making 128 pixels of the source video invisible).
For example, displaying a video fullscreen on a 1920x1080 screen with
``--video-pan-x=-0.1`` would move the video 192 pixels to the left and
``--video-pan-y=-0.1`` would move the video 108 pixels up.

This option is disabled if the ``--no-keepaspect`` option is used.

Expand Down Expand Up @@ -3440,6 +3438,10 @@ Window
mechanism in case there is good/bad behavior with whatever your combination
of hardware/drivers/etc. happens to be.

``--x11-wid-title`` ``--no-x11-wid-title``
Whether or not to set the window title when mpv is embedded on X11 (default:
``no``).


Disc Devices
------------
Expand Down Expand Up @@ -4790,6 +4792,10 @@ Terminal

See `Property Expansion`_.

``--term-remaining-playtime``, ``--no-term-remaining-playtime``
When printing out the time on the terminal, show the remaining time adjusted by
playback speed. Default: ``yes``

``--term-status-msg=<string>``
Print out a custom string during playback instead of the standard status
line. Expands properties. See `Property Expansion`_.
Expand Down Expand Up @@ -6693,12 +6699,21 @@ them.
advanced scaling is enabled. Defaults to on. (Only affects
``--vo=gpu-next``, note that ``--vo=gpu`` always delays the peak.)

``--hdr-peak-decay-rate=<1.0..1000.0>``
``--hdr-peak-percentile=<0.0..100.0>``
Which percentile of the input image brightness histogram to consider as the
true peak of the scene. If this is set to 100 (default), the
brightest pixel is measured. Otherwise, the top of the frequency
distribution is progressively cut off. Setting this too low will cause
clipping of very bright details, but can improve the dynamic brightness
range of scenes with very bright isolated highlights. Values other than 100
come with a small performance penalty. (Only for ``--vo=gpu-next``)

``--hdr-peak-decay-rate=<0.0..1000.0>``
The decay rate used for the HDR peak detection algorithm (default: 100.0).
This is only relevant when ``--hdr-compute-peak`` is enabled. Higher values
make the peak decay more slowly, leading to more stable values at the cost
of more "eye adaptation"-like effects (although this is mitigated somewhat
by ``--hdr-scene-threshold``). A value of 1.0 (the lowest possible) disables
by ``--hdr-scene-threshold``). A value of 0.0 (the lowest possible) disables
all averaging, meaning each frame's value is used directly as measured,
but doing this is not recommended for "noisy" sources since it may lead
to excessive flicker. (In signal theory terms, this controls the time
Expand Down Expand Up @@ -6913,6 +6928,14 @@ them.
The directory where gpu shader cache is stored. Cache is stored in the system's
cache directory (usually ``~/.cache/mpv``) if this is unset.

``--libplacebo-opts=<key>=<value>[,<key>=<value>[,...]]``
Passes extra raw option to the libplacebo rendering backend (used by
``--vo=gpu-next``). May override the effects of any other options set using
the normal options system. Requires libplacebo v6.309 or higher. Included
for debugging purposes only. For more information, see:

https://code.videolan.org/videolan/libplacebo/-/blob/master/src/options.c#L877

Miscellaneous
-------------

Expand Down
7 changes: 7 additions & 0 deletions DOCS/man/osc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ Configurable Options

Show total time instead of time remaining

``remaining_playtime``
Default: yes

Whether the time-remaining display takes speed into account.
``yes`` - how much playback time remains at the current speed.
``no`` - how much video-time remains.

``timems``
Default: no

Expand Down
6 changes: 6 additions & 0 deletions DOCS/man/vf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,12 @@ Available mpv-only filters are:
``display_fps``
Refresh rate of the current display. Note that this value can be 0.

``display_res``
Resolution of the current display. This is an integer array with the
first entry corresponding to the width and the second entry coresponding
to the height. These values can be 0. Note that this will not respond to
monitor changes and may not work on all platforms.

``vavpp``
VA-API video post processing. Requires the system to support VA-API,
i.e. Linux/BSD only. Works with ``--vo=vaapi`` and ``--vo=gpu`` only.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ for ideas on what you could contribute with.

## License

GPLv2 "or later" by default, LGPLv2.1 "or later" with `--enable-lgpl`.
GPLv2 "or later" by default, LGPLv2.1 "or later" with `-Dgpl=false`.
See [details.](https://github.com/mpv-player/mpv/blob/master/Copyright)

## History
Expand Down
56 changes: 41 additions & 15 deletions TOOLS/lua/autoload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ additional_image_exts=list,of,ext
additional_video_exts=list,of,ext
additional_audio_exts=list,of,ext
ignore_hidden=yes
same_type=yes
--]]

Expand All @@ -37,9 +38,17 @@ o = {
additional_image_exts = "",
additional_video_exts = "",
additional_audio_exts = "",
ignore_hidden = true
ignore_hidden = true,
same_type = false
}
options.read_options(o)
options.read_options(o, nil, function(list)
split_option_exts(list.additional_video_exts, list.additional_audio_exts, list.additional_image_exts)
if list.videos or list.additional_video_exts or
list.audio or list.additional_audio_exts or
list.images or list.additional_image_exts then
create_extensions()
end
end)

function Set (t)
local set = {}
Expand All @@ -48,10 +57,8 @@ function Set (t)
end

function SetUnion (a,b)
local res = {}
for k in pairs(a) do res[k] = true end
for k in pairs(b) do res[k] = true end
return res
for k in pairs(b) do a[k] = true end
return a
end

function Split (s)
Expand All @@ -75,14 +82,20 @@ EXTENSIONS_IMAGES = Set {
'svg', 'tga', 'tif', 'tiff', 'webp'
}

EXTENSIONS_VIDEO = SetUnion(EXTENSIONS_VIDEO, Split(o.additional_video_exts))
EXTENSIONS_AUDIO = SetUnion(EXTENSIONS_AUDIO, Split(o.additional_audio_exts))
EXTENSIONS_IMAGES = SetUnion(EXTENSIONS_IMAGES, Split(o.additional_image_exts))
function split_option_exts(video, audio, image)
if video then o.additional_video_exts = Split(o.additional_video_exts) end
if audio then o.additional_audio_exts = Split(o.additional_audio_exts) end
if image then o.additional_image_exts = Split(o.additional_image_exts) end
end
split_option_exts(true, true, true)

EXTENSIONS = Set {}
if o.videos then EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_VIDEO) end
if o.audio then EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_AUDIO) end
if o.images then EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_IMAGES) end
function create_extensions()
EXTENSIONS = {}
if o.videos then SetUnion(SetUnion(EXTENSIONS, EXTENSIONS_VIDEO), o.additional_video_exts) end
if o.audio then SetUnion(SetUnion(EXTENSIONS, EXTENSIONS_AUDIO), o.additional_audio_exts) end
if o.images then SetUnion(SetUnion(EXTENSIONS, EXTENSIONS_IMAGES), o.additional_image_exts) end
end
create_extensions()

function add_files(files)
local oldcount = mp.get_property_number("playlist-count", 1)
Expand Down Expand Up @@ -153,15 +166,28 @@ function find_and_add_entries()
end

pl_count = mp.get_property_number("playlist-count", 1)
this_ext = get_extension(filename)
-- check if this is a manually made playlist
if (pl_count > 1 and autoloaded == nil) or
(pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == nil) then
(pl_count == 1 and EXTENSIONS[string.lower(this_ext)] == nil) then
msg.verbose("stopping: manually made playlist")
return
else
autoloaded = true
end

if o.same_type then
if EXTENSIONS_VIDEO[string.lower(this_ext)] ~= nil then
EXTENSIONS_TARGET = EXTENSIONS_VIDEO
elseif EXTENSIONS_AUDIO[string.lower(this_ext)] ~= nil then
EXTENSIONS_TARGET = EXTENSIONS_AUDIO
else
EXTENSIONS_TARGET = EXTENSIONS_IMAGES
end
else
EXTENSIONS_TARGET = EXTENSIONS
end

local pl = mp.get_property_native("playlist", {})
local pl_current = mp.get_property_number("playlist-pos-1", 1)
msg.trace(("playlist-pos-1: %s, playlist: %s"):format(pl_current,
Expand All @@ -182,7 +208,7 @@ function find_and_add_entries()
if ext == nil then
return false
end
return EXTENSIONS[string.lower(ext)]
return EXTENSIONS_TARGET[string.lower(ext)]
end)
alphanumsort(files)

Expand Down
11 changes: 7 additions & 4 deletions audio/decode/ad_spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ static int init_filter(struct mp_filter *da)
{
struct spdifContext *spdif_ctx = da->priv;

AVPacket *pkt = spdif_ctx->avpkt = av_packet_alloc();
MP_HANDLE_OOM(spdif_ctx->avpkt);
AVPacket *pkt = spdif_ctx->avpkt;

int profile = FF_PROFILE_UNKNOWN;
int c_rate = 0;
Expand Down Expand Up @@ -299,14 +298,18 @@ static void process(struct mp_filter *da)
struct mp_aframe *out = NULL;
double pts = mpkt->pts;

if (!spdif_ctx->avpkt) {
spdif_ctx->avpkt = av_packet_alloc();
MP_HANDLE_OOM(spdif_ctx->avpkt);
}
mp_set_av_packet(spdif_ctx->avpkt, mpkt, NULL);
spdif_ctx->avpkt->pts = spdif_ctx->avpkt->dts = 0;
if (!spdif_ctx->lavf_ctx) {
if (init_filter(da) < 0)
goto done;
assert(spdif_ctx->avpkt);
}

mp_set_av_packet(spdif_ctx->avpkt, mpkt, NULL);
spdif_ctx->avpkt->pts = spdif_ctx->avpkt->dts = 0;
spdif_ctx->out_buffer_len = 0;
int ret = av_write_frame(spdif_ctx->lavf_ctx, spdif_ctx->avpkt);
avio_flush(spdif_ctx->lavf_ctx->pb);
Expand Down
2 changes: 1 addition & 1 deletion audio/out/ao.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void ao_set_gain(struct ao *ao, float gain);
double ao_get_delay(struct ao *ao);
void ao_reset(struct ao *ao);
void ao_start(struct ao *ao);
void ao_set_paused(struct ao *ao, bool paused);
void ao_set_paused(struct ao *ao, bool paused, bool eof);
void ao_drain(struct ao *ao);
bool ao_is_playing(struct ao *ao);
struct mp_async_queue;
Expand Down
Loading

0 comments on commit bb02f35

Please sign in to comment.