summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2019-03-11 01:00:27 +0200
committerJan Ekström <jeebjp@gmail.com>2019-03-11 01:00:27 +0200
commit199aabddcc0105b504cc8e0cb240bc3c89288c1a (patch)
treefa7eb297a8e11b5e0d9339196f23918d6a4d0b85
parent7c565547b80fdc2a1bfdf31f9725129bcb16aa9d (diff)
parent1d0349d3b5d9a263251fcb3b0d7e135d4731bfd0 (diff)
downloadmpv-199aabddcc0105b504cc8e0cb240bc3c89288c1a.tar.bz2
mpv-199aabddcc0105b504cc8e0cb240bc3c89288c1a.tar.xz
Merge branch 'master' into pr6360
Manual changes done: * Merged the interface-changes under the already master'd changes. * Moved the hwdec-related option changes to video/decode/vd_lavc.c.
-rw-r--r--DOCS/interface-changes.rst6
-rw-r--r--DOCS/man/input.rst4
-rw-r--r--DOCS/man/options.rst89
-rw-r--r--demux/demux.c9
-rw-r--r--demux/demux_edl.c4
-rw-r--r--demux/demux_lavf.c33
-rw-r--r--filters/f_swresample.c2
-rw-r--r--osdep/macOS_swift_bridge.h8
-rw-r--r--osdep/macOS_swift_extensions.swift58
-rw-r--r--osdep/macosx_compat.h2
-rw-r--r--player/command.c1
-rw-r--r--player/loadfile.c2
-rw-r--r--player/lua/defaults.lua9
-rw-r--r--player/lua/stats.lua8
-rw-r--r--stream/stream_dvb.c4
-rw-r--r--sub/filter_sdh.c5
-rw-r--r--video/decode/vd_lavc.c4
-rw-r--r--video/out/cocoa-cb/events_view.swift3
-rw-r--r--video/out/cocoa-cb/window.swift5
-rw-r--r--video/out/cocoa_cb_common.swift25
-rw-r--r--video/out/gpu/lcms.c2
-rw-r--r--video/out/gpu/user_shaders.c5
-rw-r--r--video/out/gpu/user_shaders.h2
-rw-r--r--video/out/gpu/video.c130
-rw-r--r--video/out/gpu/video.h20
-rw-r--r--video/out/gpu/video_shaders.c216
-rw-r--r--video/out/gpu/video_shaders.h6
-rw-r--r--video/out/opengl/common.c1
-rw-r--r--video/out/opengl/context_drm_egl.c209
-rw-r--r--video/out/wayland_common.c20
-rw-r--r--video/out/wayland_common.h2
-rw-r--r--wscript_build.py7
32 files changed, 583 insertions, 318 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst
index 3aa2a541e8..160bc3679c 100644
--- a/DOCS/interface-changes.rst
+++ b/DOCS/interface-changes.rst
@@ -47,6 +47,12 @@ Interface changes
- support for `--spirv-compiler=nvidia` has been removed, leaving `shaderc`
as the only option. The `--spirv-compiler` option itself has been marked
as deprecated, and may be removed in the future.
+ - split up `--tone-mapping-desaturate`` into strength + exponent, instead of
+ only using a single value (which previously just controlled the exponent).
+ The strength now linearly blends between the linear and nonlinear tone
+ mapped versions of a color.
+ - add --hdr-peak-decay-rate and --hdr-scene-threshold-low/high
+ - add --tone-mapping-max-boost
- ipc: require that "request_id" fields are integers. Other types are still
accepted for compatibility, but this will stop in the future. Also, if no
request_id is provided, 0 will be assumed.
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index 6bf196931c..b2d676c644 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -1817,7 +1817,9 @@ Property list
are the xrandr names (LVDS1, HDMI1, DP1, VGA1, etc.). On Windows, these
are the GDI names (\\.\DISPLAY1, \\.\DISPLAY2, etc.) and the first display
in the list will be the one that Windows considers associated with the
- window (as determined by the MonitorFromWindow API.)
+ window (as determined by the MonitorFromWindow API.) On macOS these are the
+ Display Product Names as used in the System Information and only one display
+ name is returned since a window can only be on one screen.
``display-fps`` (RW)
The refresh rate of the current display. Currently, this is the lowest FPS
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index f384123f6d..e3eb46495b 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -1092,7 +1092,7 @@ Video
You can get the list of allowed codecs with ``mpv --vd=help``. Remove the
prefix, e.g. instead of ``lavc:h264`` use ``h264``.
- By default, this is set to ``h264,vc1,wmv3,hevc,mpeg2video,vp9``. Note that
+ By default, this is set to ``h264,vc1,hevc,vp9``. Note that
the hardware acceleration special codecs like ``h264_vdpau`` are not
relevant anymore, and in fact have been removed from Libav in this form.
@@ -1326,8 +1326,10 @@ Audio
Since mpv 0.18.1, this always controls the internal mixer (aka "softvol").
``--replaygain=<no|track|album>``
- Adjust volume gain according to the track-gain or album-gain replaygain
- value stored in the file metadata (default: no replaygain).
+ Adjust volume gain according to replaygain values stored in the file
+ metadata. With ``--replaygain=no`` (the default), perform no adjustment.
+ With ``--replaygain=track``, apply track gain. With ``--replaygain=album``,
+ apply album gain if present and fall back to track gain otherwise.
``--replaygain-preamp=<db>``
Pre-amplification gain in dB to apply to the selected replaygain gain
@@ -3988,8 +3990,8 @@ Network
DVB
---
-``--dvbin-card=<1-4>``
- Specifies using card number 1-4 (default: 1).
+``--dvbin-card=<0-15>``
+ Specifies using card number 0-15 (default: 0).
``--dvbin-file=<filename>``
Instructs mpv to read the channels list from ``<filename>``. The default is
@@ -5073,7 +5075,7 @@ The following video options are currently all specific to ``--vo=gpu`` and
The user should independently guarantee this before using these signal
formats for display.
-``--target-peak=<nits>``
+``--target-peak=<auto|nits>``
Specifies the measured peak brightness of the output display, in cd/m^2
(AKA nits). The interpretation of this brightness depends on the configured
``--target-trc``. In all cases, it imposes a limit on the signal values
@@ -5085,9 +5087,9 @@ The following video options are currently all specific to ``--vo=gpu`` and
above 100 essentially causes the display to be treated as if it were an HDR
display in disguise. (See the note below)
- By default, the chosen peak defaults to an appropriate value based on the
- TRC in use. For SDR curves, it defaults to 100. For HDR curves, it
- defaults to 100 * the transfer function's nominal peak.
+ In ``auto`` mode (the default), the chosen peak is an appropriate value
+ based on the TRC in use. For SDR curves, it uses 100. For HDR curves, it
+ uses 100 * the transfer function's nominal peak.
.. note::
@@ -5164,6 +5166,14 @@ The following video options are currently all specific to ``--vo=gpu`` and
linear
Specifies the scale factor to use while stretching. Defaults to 1.0.
+``--tone-mapping-max-boost=<1.0..10.0>``
+ Upper limit for how much the tone mapping algorithm is allowed to boost
+ the average brightness by over-exposing the image. The default value of 1.0
+ allows no additional brightness boost. A value of 2.0 would allow
+ over-exposing by a factor of 2, and so on. Raising this setting can help
+ reveal details that would otherwise be hidden in dark scenes, but raising
+ it too high will make dark scenes appear unnaturally bright.
+
``--hdr-compute-peak=<auto|yes|no>``
Compute the HDR peak and frame average brightness per-frame instead of
relying on tagged metadata. These values are averaged over local regions as
@@ -5174,17 +5184,50 @@ The following video options are currently all specific to ``--vo=gpu`` and
The special value ``auto`` (default) will enable HDR peak computation
automatically if compute shaders and SSBOs are supported.
-``--tone-mapping-desaturate=<value>``
- Apply desaturation for highlights. The parameter essentially controls the
- steepness of the desaturation curve. The higher the parameter, the more
- aggressively colors will be desaturated. This setting helps prevent
- unnaturally blown-out colors for super-highlights, by (smoothly) turning
- into white instead. This makes images feel more natural, at the cost of
- reducing information about out-of-range colors.
-
- The default of 0.5 provides a good balance. This value is weaker than the
- ACES ODT curves' recommendation, but works better for most content in
- practice. A setting of 0.0 disables this option.
+``--hdr-peak-decay-rate=<1.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
+ 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
+ constant "tau" of an IIR low pass filter)
+
+``--hdr-scene-threshold-low=<0.0..100.0>``, ``--hdr-scene-threshold-high=<0.0..100.0>``
+ The lower and upper thresholds (in dB) for a brightness difference
+ to be considered a scene change (default: 5.5 low, 10.0 high). This is only
+ relevant when ``--hdr-compute-peak`` is enabled. Normally, small
+ fluctuations in the frame brightness are compensated for by the peak
+ averaging mechanism, but for large jumps in the brightness this can result
+ in the frame remaining too bright or too dark for up to several seconds,
+ depending on the value of ``--hdr-peak-decay-rate``. To counteract this,
+ when the brightness between the running average and the current frame
+ exceeds the low threshold, mpv will make the averaging filter more
+ aggressive, up to the limit of the high threshold (at which point the
+ filter becomes instant).
+
+``--tone-mapping-desaturate=<0.0..1.0>``
+ Apply desaturation for highlights (default: 0.75). The parameter controls
+ the strength of the desaturation curve. A value of 0.0 completely disables
+ it, while a value of 1.0 means that overly bright colors will tend towards
+ white. (This is not always the case, especially not for highlights that are
+ near primary colors)
+
+ Values in between apply progressively more/less aggressive desaturation.
+ This setting helps prevent unnaturally oversaturated colors for
+ super-highlights, by (smoothly) turning them into less saturated (per
+ channel tone mapped) colors instead. This makes images feel more natural,
+ at the cost of chromatic distortions for out-of-range colors. The default
+ value of 0.75 provides a good balance. Setting this to 0.0 preserves the
+ chromatic accuracy of the tone mapping process.
+
+``--tone-mapping-desaturate-exponent=<0.0..20.0>``
+ This setting controls the exponent of the desaturation curve, which
+ controls how bright a color needs to be in order to start being
+ desaturated. The default of 1.5 provides a reasonable balance. Decreasing
+ this exponent makes the curve more aggressive.
``--gamut-warning``
If enabled, mpv will mark all clipped/out-of-gamut pixels that exceed a
@@ -5245,12 +5288,14 @@ The following video options are currently all specific to ``--vo=gpu`` and
Size of the 3D LUT generated from the ICC profile in each dimension.
Default is 64x64x64. Sizes may range from 2 to 512.
-``--icc-contrast=<0-1000000>``
+``--icc-contrast=<0-1000000|inf>``
Specifies an upper limit on the target device's contrast ratio. This is
detected automatically from the profile if possible, but for some profiles
it might be missing, causing the contrast to be assumed as infinite. As a
result, video may appear darker than intended. This only affects BT.1886
- content. The default of 0 means no limit.
+ content. The default of 0 means no limit if the detected contrast is less
+ than 100000, and limits to 1000 otherwise. Use ``--icc-contrast=inf`` to
+ preserve the infinite contrast (most likely when using OLED displays).
``--blend-subtitles=<yes|video|no>``
Blend subtitles directly onto upscaled video frames, before interpolation
diff --git a/demux/demux.c b/demux/demux.c
index 4e1fb57c72..45a2ad65b6 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -1715,8 +1715,6 @@ static void prune_old_packets(struct demux_internal *in)
}
prev = prev->next;
}
-
- update_seek_ranges(range);
}
bool done = false;
@@ -1725,6 +1723,8 @@ static void prune_old_packets(struct demux_internal *in)
remove_head_packet(queue);
}
+ update_seek_ranges(range);
+
if (range != in->current_range && range->seek_start == MP_NOPTS_VALUE)
free_empty_cached_ranges(in);
}
@@ -2100,12 +2100,17 @@ static struct replaygain_data *decode_rgain(struct mp_log *log,
{
struct replaygain_data rg = {0};
+ // Set values in *rg, using track gain as a fallback for album gain if the
+ // latter is not present. This behavior matches that in demux/demux_lavf.c's
+ // export_replaygain; if you change this, please make equivalent changes
+ // there too.
if (decode_gain(log, tags, "REPLAYGAIN_TRACK_GAIN", &rg.track_gain) >= 0 &&
decode_peak(log, tags, "REPLAYGAIN_TRACK_PEAK", &rg.track_peak) >= 0)
{
if (decode_gain(log, tags, "REPLAYGAIN_ALBUM_GAIN", &rg.album_gain) < 0 ||
decode_peak(log, tags, "REPLAYGAIN_ALBUM_PEAK", &rg.album_peak) < 0)
{
+ // Album gain is undefined; fall back to track gain.
rg.album_gain = rg.track_gain;
rg.album_peak = rg.track_peak;
}
diff --git a/demux/demux_edl.c b/demux/demux_edl.c
index b724ffa592..7f85568eae 100644
--- a/demux/demux_edl.c
+++ b/demux/demux_edl.c
@@ -80,8 +80,10 @@ static struct tl_parts *parse_edl(bstr str)
{
struct tl_parts *tl = talloc_zero(NULL, struct tl_parts);
while (str.len) {
- if (bstr_eatstart0(&str, "#"))
+ if (bstr_eatstart0(&str, "#")) {
bstr_split_tok(str, "\n", &(bstr){0}, &str);
+ continue;
+ }
if (bstr_eatstart0(&str, "\n") || bstr_eatstart0(&str, ";"))
continue;
bool is_header = bstr_eatstart0(&str, "!");
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index ad71937580..8ec856d0c8 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2004 Michael Niedermayer <michaelni@gmx.at>
+ * Copyright (C) 2018 Google LLC
*
* This file is part of mpv.
*
@@ -588,17 +589,27 @@ static void export_replaygain(demuxer_t *demuxer, struct sh_stream *sh,
av_rgain = (AVReplayGain*)src_sd->data;
rgain = talloc_ptrtype(demuxer, rgain);
- rgain->track_gain = (av_rgain->track_gain != INT32_MIN) ?
- av_rgain->track_gain / 100000.0f : 0.0;
-
- rgain->track_peak = (av_rgain->track_peak != 0.0) ?
- av_rgain->track_peak / 100000.0f : 1.0;
-
- rgain->album_gain = (av_rgain->album_gain != INT32_MIN) ?
- av_rgain->album_gain / 100000.0f : 0.0;
-
- rgain->album_peak = (av_rgain->album_peak != 0.0) ?
- av_rgain->album_peak / 100000.0f : 1.0;
+ // Set values in *rgain, using track gain as a fallback for album gain
+ // if the latter is not present. This behavior matches that in
+ // demux/demux.c's decode_rgain; if you change this, please make
+ // equivalent changes there too.
+ if (av_rgain->track_gain != INT32_MIN && av_rgain->track_peak != 0.0) {
+ // Track gain is defined.
+ rgain->track_gain = av_rgain->track_gain / 100000.0f;
+ rgain->track_peak = av_rgain->track_peak / 100000.0f;
+
+ if (av_rgain->album_gain != INT32_MIN &&
+ av_rgain->album_peak != 0.0)
+ {
+ // Album gain is also defined.
+ rgain->album_gain = av_rgain->album_gain / 100000.0f;
+ rgain->album_peak = av_rgain->album_peak / 100000.0f;
+ } else {
+ // Album gain is undefined; fall back to track gain.
+ rgain->album_gain = rgain->track_gain;
+ rgain->album_peak = rgain->track_peak;
+ }
+ }
// This must be run only before the stream was added, otherwise there
// will be race conditions with accesses from the user thread.
diff --git a/filters/f_swresample.c b/filters/f_swresample.c
index 49f69cbbd7..8ee44195a8 100644
--- a/filters/f_swresample.c
+++ b/filters/f_swresample.c
@@ -399,7 +399,7 @@ static bool reorder_planes(struct mp_aframe *mpa, int *reorder,
if (!mp_aframe_set_chmap(mpa, newmap))
return false;
- int num_planes = newmap->num;
+ int num_planes = mp_aframe_get_planes(mpa);
uint8_t **planes = mp_aframe_get_data_rw(mpa);
uint8_t *old_planes[MP_NUM_CHANNELS];
assert(num_planes <= MP_NUM_CHANNELS);
diff --git a/osdep/macOS_swift_bridge.h b/osdep/macOS_swift_bridge.h
index 4204b514d1..f0b549ca40 100644
--- a/osdep/macOS_swift_bridge.h
+++ b/osdep/macOS_swift_bridge.h
@@ -49,3 +49,11 @@ static int SWIFT_KEY_MOUSE_LEAVE = MP_KEY_MOUSE_LEAVE;
static int SWIFT_KEY_MOUSE_ENTER = MP_KEY_MOUSE_ENTER;
static int SWIFT_KEY_STATE_DOWN = MP_KEY_STATE_DOWN;
static int SWIFT_KEY_STATE_UP = MP_KEY_STATE_UP;
+
+// only used from Swift files and therefore seen as unused by the c compiler
+static void SWIFT_TARRAY_STRING_APPEND(void *t, char ***a, int *i, char *s) __attribute__ ((unused));
+
+static void SWIFT_TARRAY_STRING_APPEND(void *t, char ***a, int *i, char *s)
+{
+ MP_TARRAY_APPEND(t, *a, *i, s);
+}
diff --git a/osdep/macOS_swift_extensions.swift b/osdep/macOS_swift_extensions.swift
new file mode 100644
index 0000000000..14d217f589
--- /dev/null
+++ b/osdep/macOS_swift_extensions.swift
@@ -0,0 +1,58 @@
+/*
+ * This file is part of mpv.
+ *
+ * mpv is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * mpv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with mpv. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import Cocoa
+
+extension NSScreen {
+
+ public var displayID: CGDirectDisplayID {
+ get {
+ return deviceDescription["NSScreenNumber"] as! CGDirectDisplayID
+ }
+ }
+
+ public var displayName: String? {
+ get {
+ var name: String? = nil
+ var object: io_object_t
+ var iter = io_iterator_t()
+ let matching = IOServiceMatching("IODisplayConnect")
+ let result = IOServiceGetMatchingServices(kIOMasterPortDefault, matching, &iter)
+
+ if result != KERN_SUCCESS || iter == 0 { return nil }
+
+ repeat {
+ object = IOIteratorNext(iter)
+ let info = IODisplayCreateInfoDictionary(object, IOOptionBits(kIODisplayOnlyPreferredName)).takeRetainedValue() as! [String:AnyObject]
+ if (info[kDisplayVendorID] as? UInt32 == CGDisplayVendorNumber(displayID) &&
+ info[kDisplayProductID] as? UInt32 == CGDisplayModelNumber(displayID) &&
+ info[kDisplaySerialNumber] as? UInt32 ?? 0 == CGDisplaySerialNumber(displayID))
+ {
+ if let productNames = info["DisplayProductName"] as? [String:String],
+ let productName = productNames.first?.value
+ {
+ name = productName
+ break
+ }
+ }
+ } while object != 0
+
+ IOObjectRelease(iter)
+ return name
+ }
+ }
+}
diff --git a/osdep/macosx_compat.h b/osdep/macosx_compat.h
index 747aa159af..d5f8dab571 100644
--- a/osdep/macosx_compat.h
+++ b/osdep/macosx_compat.h
@@ -55,7 +55,7 @@ static const NSEventModifierFlags NSEventModifierFlagOption = NSAlternateKeyMask
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9)
typedef NSUInteger NSModalResponse;
-static const NSModalResponse NSModalResponseOK = NSFileHandlingPanelOKButton
+static const NSModalResponse NSModalResponseOK = NSFileHandlingPanelOKButton;
#endif
#endif
diff --git a/player/command.c b/player/command.c
index 4d0fbefc34..0dc9e9a8b9 100644
--- a/player/command.c
+++ b/player/command.c
@@ -4052,6 +4052,7 @@ static bool is_property_set(int action, void *val)
case M_PROPERTY_SWITCH:
case M_PROPERTY_SET_STRING:
case M_PROPERTY_SET_NODE:
+ case M_PROPERTY_MULTIPLY:
return true;
case M_PROPERTY_KEY_ACTION: {
struct m_property_action_arg *key = val;
diff --git a/player/loadfile.c b/player/loadfile.c
index 4dff4c710c..f55dd29f34 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -752,7 +752,7 @@ int mp_add_external_file(struct MPContext *mpctx, char *filename,
if (!demuxer)
goto err_out;
- if (opts->rebase_start_time)
+ if (filter != STREAM_SUB && opts->rebase_start_time)
demux_set_ts_offset(demuxer, -demuxer->start_time);
bool has_any = false;
diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua
index 1da6420182..523b649b8c 100644
--- a/player/lua/defaults.lua
+++ b/player/lua/defaults.lua
@@ -476,12 +476,9 @@ function mp.dispatch_events(allow_wait)
while mp.keep_running do
local wait = 0
if not more_events then
- wait = process_timers()
- if wait == nil then
- for _, handler in ipairs(idle_handlers) do
- handler()
- end
- wait = 1e20 -- infinity for all practical purposes
+ wait = process_timers() or 1e20 -- infinity for all practical purposes
+ for _, handler in ipairs(idle_handlers) do
+ handler()
end
-- Resume playloop - important especially if an error happened while
-- suspended, and the error was handled, but no resume was done.
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index 6272aab9c2..db3df01c6d 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -430,7 +430,8 @@ local function add_file(s)
append_property(s, "media-title", {prefix="Title:"})
end
- append_property(s, "file-format", {prefix="Format/Protocol:"})
+ local fs = append_property(s, "file-size", {prefix="Size:"})
+ append_property(s, "file-format", {prefix="Format/Protocol:", nl=fs and "" or o.nl})
local ch_index = mp.get_property_number("chapter")
if ch_index and ch_index >= 0 then
@@ -457,7 +458,6 @@ local function add_file(s)
indent=o.prefix_sep, no_prefix_markup=true})
end
end
- append_property(s, "file-size", {prefix="Size:"})
end
@@ -536,9 +536,9 @@ local function add_audio(s)
append(s, "", {prefix=o.nl .. o.nl .. "Audio:", nl="", indent=""})
append_property(s, "audio-codec", {prefix_sep="", nl="", indent=""})
- append(s, r["format"], {prefix="Format:"})
+ local cc = append(s, r["channel-count"], {prefix="Channels:"})
+ append(s, r["format"], {prefix="Format:", nl=cc and "" or o.nl})
append(s, r["samplerate"], {prefix="Sample Rate:", suffix=" Hz"})
- append(s, r["channel-count"], {prefix="Channels:"})
append_property(s, "packet-audio-bitrate", {prefix="Bitrate:", suffix=" kbps"})
append_filters(s, "af", "Filters:")
end
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c
index fa58f633ec..20ed3337c4 100644
--- a/stream/stream_dvb.c
+++ b/stream/stream_dvb.c
@@ -73,7 +73,7 @@ static pthread_mutex_t global_dvb_state_lock = PTHREAD_MUTEX_INITIALIZER;
const struct m_sub_options stream_dvb_conf = {
.opts = (const m_option_t[]) {
OPT_STRING("prog", cfg_prog, 0),
- OPT_INTRANGE("card", cfg_devno, 0, 1, 4),
+ OPT_INTRANGE("card", cfg_devno, 0, 0, MAX_ADAPTERS-1),
OPT_INTRANGE("timeout", cfg_timeout, 0, 1, 30),
OPT_STRING("file", cfg_file, M_OPT_FILE),
OPT_FLAG("full-transponder", cfg_full_transponder, 0),
@@ -1157,7 +1157,7 @@ dvb_state_t *dvb_get_state(stream_t *stream)
if (devno.len) {
bstr r;
priv->cfg_devno = bstrtoll(devno, &r, 0);
- if (r.len || priv->cfg_devno < 0 || priv->cfg_devno > MAX_ADAPTERS) {
+ if (r.len || priv->cfg_devno < 0 || priv->cfg_devno >= MAX_ADAPTERS) {
MP_ERR(stream, "invalid devno: '%.*s'\n", BSTR_P(devno));
return NULL;
}
diff --git a/sub/filter_sdh.c b/sub/filter_sdh.c
index ce8c28ed0a..a04f33a23e 100644
--- a/sub/filter_sdh.c
+++ b/sub/filter_sdh.c
@@ -406,8 +406,11 @@ char *filter_SDH(struct sd *sd, char *format, int n_ignored, char *data, int len
line_with_text = true;
}
} else if (*rp && rp[0] != '\\') {
- if (rp[0] > 32 && rp[0] < 127 && rp[0] != '-')
+ if ((rp[0] > 32 && rp[0] < 127 && rp[0] != '-') ||
+ (unsigned char)rp[0] >= 0xC0)
+ {
line_with_text = true;
+ }
append(sd, buf, rp[0]);
rp++;
} else if (rp[0] == '\\' && rp[1] != 'N') {
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 17c719b710..97b3fa8b7d 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -140,13 +140,13 @@ const struct m_sub_options vd_lavc_conf = {
.framedrop = AVDISCARD_NONREF,
.dr = 1,
.hwdec_api = HAVE_RPI ? "mmal" : "no",
- .hwdec_codecs = "h264,vc1,wmv3,hevc,mpeg2video,vp9",
+ .hwdec_codecs = "h264,vc1,hevc,vp9",
},
};
struct hwdec_info {
char name[64];
- char method_name[16]; // non-unique name describing the hwdec method
+ char method_name[24]; // non-unique name describing the hwdec method
const AVCodec *codec; // implemented by this codec
enum AVHWDeviceType lavc_device; // if not NONE, get a hwdevice
bool copying; // if true, outputs sw frames, or copy to sw ourselves
diff --git a/video/out/cocoa-cb/events_view.swift b/video/out/cocoa-cb/events_view.swift
index 5a84d27b2b..667366285e 100644
--- a/video/out/cocoa-cb/events_view.swift
+++ b/video/out/cocoa-cb/events_view.swift
@@ -75,7 +75,8 @@ class EventsView: NSView {
return true
}
} else if types.contains(NSURLPboardType) {
- if let url = pb.propertyList(forType: NSURLPboardType) as? [Any] {
+ if var url = pb.propertyList(forType: NSURLPboardType) as? [String] {
+ url = url.filter{ !$0.isEmpty }
EventsResponder.sharedInstance().handleFilesArray(url)
return true
}
diff --git a/video/out/cocoa-cb/window.swift b/video/out/cocoa-cb/window.swift
index d11706f38b..ad93a9cebd 100644
--- a/video/out/cocoa-cb/window.swift
+++ b/video/out/cocoa-cb/window.swift
@@ -300,6 +300,7 @@ class Window: NSWindow, NSWindowDelegate {
let intermediateFrame = aspectFit(rect: newFrame, in: screen!.frame)
cocoaCB.view.layerContentsPlacement = .scaleProportionallyToFill
hideTitleBar()
+ styleMask.remove(.fullScreen)
setFrame(intermediateFrame, display: true)
NSAnimationContext.runAnimationGroup({ (context) -> Void in
@@ -435,9 +436,7 @@ class Window: NSWindow, NSWindowDelegate {
}
override func setFrame(_ frameRect: NSRect, display flag: Bool) {
- let newFrame = !isAnimating && isInFullscreen ? targetScreen!.frame :
- frameRect
- super.setFrame(newFrame, display: flag)
+ super.setFrame(frameRect, display: flag)
if keepAspect {
contentAspectRatio = unfsContentFrame!.size
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift
index 355fa537e1..ae79144d97 100644
--- a/video/out/cocoa_cb_common.swift
+++ b/video/out/cocoa_cb_common.swift
@@ -148,10 +148,9 @@ class CocoaCB: NSObject {
func startDisplayLink(_ vo: UnsafeMutablePointer<vo>) {
let opts: mp_vo_opts = vo.pointee.opts.pointee
let screen = getScreenBy(id: Int(opts.screen_id)) ?? NSScreen.main()
- let displayId = screen!.deviceDescription["NSScreenNumber"] as! UInt32
CVDisplayLinkCreateWithActiveCGDisplays(&link)
- CVDisplayLinkSetCurrentCGDisplay(link!, displayId)
+ CVDisplayLinkSetCurrentCGDisplay(link!, screen!.displayID)
if #available(macOS 10.12, *) {
CVDisplayLinkSetOutputHandler(link!) { link, now, out, inFlags, outFlags -> CVReturn in
self.mpv.reportRenderFlip()
@@ -170,8 +169,7 @@ class CocoaCB: NSObject {
}