Skip to content

Commit

Permalink
Merge branch 'mpv-player:master' into plex-htpc-patches
Browse files Browse the repository at this point in the history
  • Loading branch information
mitzsch authored Jun 14, 2024
2 parents 641cdab + 3fa0945 commit 24aadc9
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 174 deletions.
1 change: 1 addition & 0 deletions DOCS/interface-changes/vapoursynth-api-v4.txt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump dependency of VapourSynth to utilize its API version 4. New minimum VapourSynth version for runtime is R56. Some functions and plugins are changed or removed. For details, refer to VapourSynth documentation http://www.vapoursynth.com/2021/09/r55-audio-support-and-improved-performance/ and https://github.com/vapoursynth/vapoursynth/blob/R68/APIV4%20changes.txt
27 changes: 16 additions & 11 deletions demux/demux_lavf.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ struct format_hack {
bool no_pcm_seek : 1;
bool no_seek_on_no_duration : 1;
bool readall_on_no_streamseek : 1;
bool first_frame_only : 1;
};

#define BLACKLIST(fmt) {fmt, .ignore = true}
Expand Down Expand Up @@ -190,6 +191,10 @@ static const struct format_hack format_hacks[] = {
// reset timestamps, which causes all sorts of problems.
{"ogg", .linearize_audio_ts = true, .use_stream_ids = true},

// Ignore additional metadata as frames from some single frame JPEGs
// (e.g. gain map)
{"jpeg_pipe", .first_frame_only = true},

// At some point, FFmpeg lost the ability to read gif from unseekable
// streams.
{"gif", .readall_on_no_streamseek = true},
Expand Down Expand Up @@ -465,18 +470,12 @@ static int lavf_check_file(demuxer_t *demuxer, enum demux_check check)
}
}

// HLS streams do not seem to be well tagged, so matching by MIME type is
// not enough - we need to strip the query string and match by their
// extensions. We also pass jpg filenames to fix issues like #13192 (jpgs
// being treated as videos due to a bogus second frame) and #13431 (jpgs
// misdetected as mpegts). We don't pass filenames otherwise to not
// misdetect files with a wrong extension, as described in 74e62ed2d1.
bstr ext = bstr_get_ext(mp_is_url(bstr0(priv->filename))
? bstr_split(bstr0(priv->filename), "?#", NULL)
: bstr0(priv->filename));
// HLS streams seems to be not well tagged, so matching mime type is not
// enough. Strip URL parameters and match extension.
bstr ext = bstr_get_ext(bstr_split(bstr0(priv->filename), "?#", NULL));
AVProbeData avpd = {
// Disable file-extension matching with normal checks, except for HLS
.filename = !bstrcasecmp0(ext, "m3u8") || !bstrcasecmp0(ext, "m3u") ||
!bstrcasecmp0(ext, "jpg") || !bstrcasecmp0(ext, "jpeg") ||
check <= DEMUX_CHECK_REQUEST ? priv->filename : "",
.buf_size = 0,
.buf = av_mallocz(PROBE_BUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE),
Expand Down Expand Up @@ -951,7 +950,7 @@ static int nested_io_open(struct AVFormatContext *s, AVIOContext **pb,
struct demuxer *demuxer = s->opaque;
lavf_priv_t *priv = demuxer->priv;

if (priv->opts->propagate_opts) {
if (options && priv->opts->propagate_opts) {
// Copy av_opts to options, but only entries that are not present in
// options. (Hope this will break less by not overwriting important
// settings.)
Expand Down Expand Up @@ -1261,6 +1260,12 @@ static bool demux_lavf_read_packet(struct demuxer *demux,
struct sh_stream *stream = info->sh;
AVStream *st = priv->avfc->streams[pkt->stream_index];

// Never send additional frames for streams that are a single frame.
if (stream->image && priv->format_hack.first_frame_only && pkt->pos != 0) {
av_packet_unref(pkt);
return true;
}

if (!demux_stream_is_selected(stream)) {
av_packet_unref(pkt);
return true; // don't signal EOF if skipping a packet
Expand Down
2 changes: 1 addition & 1 deletion etc/input.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#ZOOMOUT add video-zoom -0.1 # zoom out
#Ctrl+WHEEL_UP add video-zoom 0.1 # zoom in
#Ctrl+WHEEL_DOWN add video-zoom -0.1 # zoom out
#Alt+BS set video-zoom 0 ; set video-pan-x 0 ; set video-pan-y 0 # reset zoom and pan settings
#Alt+BS set video-zoom 0; set panscan 0; set video-pan-x 0; set video-pan-y 0 # reset zoom and pan settings
#PGUP add chapter 1 # seek to the next chapter
#PGDWN add chapter -1 # seek to the previous chapter
#Shift+PGUP seek 600 # seek 10 minutes forward
Expand Down
1 change: 1 addition & 0 deletions input/keycodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ static const struct key_name key_names[] = {
{ MP_KEY_KPPGUP, "KP_PGUP" },
{ MP_KEY_KPPGDOWN, "KP_PGDWN" },
{ MP_KEY_KPRIGHT, "KP_RIGHT" },
{ MP_KEY_KPBEGIN, "KP_BEGIN" },
{ MP_KEY_KPLEFT, "KP_LEFT" },
{ MP_KEY_KPDOWN, "KP_DOWN" },
{ MP_KEY_KPUP, "KP_UP" },
Expand Down
1 change: 1 addition & 0 deletions input/keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
#define MP_KEY_KPLEFT (MP_KEY_KEYPAD+19)
#define MP_KEY_KPDOWN (MP_KEY_KEYPAD+20)
#define MP_KEY_KPUP (MP_KEY_KEYPAD+21)
#define MP_KEY_KPBEGIN (MP_KEY_KEYPAD+22)

// Mouse events from VOs
#define MP_MBTN_BASE ((MP_KEY_BASE+0xA0)|MP_NO_REPEAT_KEY|MP_KEY_EMIT_ON_UP)
Expand Down
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,8 @@ if not features['lavu-uuid']
sources += files('misc/uuid.c')
endif

vapoursynth = dependency('vapoursynth', version: '>= 26', required: get_option('vapoursynth'))
vapoursynth_script = dependency('vapoursynth-script', version: '>= 26',
vapoursynth = dependency('vapoursynth', version: '>= 56', required: get_option('vapoursynth'))
vapoursynth_script = dependency('vapoursynth-script', version: '>= 56',
required: get_option('vapoursynth'))
features += {'vapoursynth': vapoursynth.found() and vapoursynth_script.found()}
if features['vapoursynth']
Expand Down
2 changes: 1 addition & 1 deletion osdep/terminal-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static const struct key_entry keys[] = {
{"\033[B", MP_KEY_DOWN},
{"\033[C", MP_KEY_RIGHT},
{"\033[D", MP_KEY_LEFT},
{"\033[E", MP_KEY_KP5},
{"\033[E", MP_KEY_KPBEGIN},
{"\033[F", MP_KEY_END},
{"\033[H", MP_KEY_HOME},

Expand Down
2 changes: 1 addition & 1 deletion osdep/w32_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static const struct keymap vk_map[] = {

// numpad without numlock
{VK_INSERT, MP_KEY_KPINS}, {VK_END, MP_KEY_KPEND}, {VK_DOWN, MP_KEY_KPDOWN},
{VK_NEXT, MP_KEY_KPPGDOWN}, {VK_LEFT, MP_KEY_KPLEFT}, {VK_CLEAR, MP_KEY_KP5},
{VK_NEXT, MP_KEY_KPPGDOWN}, {VK_LEFT, MP_KEY_KPLEFT}, {VK_CLEAR, MP_KEY_KPBEGIN},
{VK_RIGHT, MP_KEY_KPRIGHT}, {VK_HOME, MP_KEY_KPHOME}, {VK_UP, MP_KEY_KPUP},
{VK_PRIOR, MP_KEY_KPPGUP}, {VK_DELETE, MP_KEY_KPDEL},

Expand Down
1 change: 0 additions & 1 deletion player/lua/console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,6 @@ set_active = function (active)
if active then
repl_active = true
insert_mode = false
mp.enable_key_bindings('console-input', 'allow-hide-cursor+allow-vo-dragging')
define_key_bindings()

if not input_caller then
Expand Down
4 changes: 2 additions & 2 deletions player/lua/stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ local function append_perfdata(header, s, dedicated_page)
end
-- Calculate font weight. 100 is minimum, 400 is normal, 700 bold, 900 is max
local w = (700 * math.sqrt(i)) + 200
return format("{\\b%d}%2d%%{\\b0}", w, i * 100)
return format("{\\b%d}%3d%%{\\b0}", w, i * 100)
end

-- ensure that the fixed title is one element and every scrollable line is
Expand All @@ -372,7 +372,7 @@ local function append_perfdata(header, s, dedicated_page)
s[#s+1] = format(f, o.nl, o.indent, o.indent,
o.font_mono, pp(pass["last"]),
pp(pass["avg"]), pp(pass["peak"]),
o.prefix_sep .. "\\h\\h", p(pass["last"], last_s[frame]),
o.prefix_sep .. "\\h", p(pass["last"], last_s[frame]),
o.font, o.prefix_sep, o.prefix_sep, pass["desc"])

if o.plot_perfdata and o.use_ass then
Expand Down
Loading

0 comments on commit 24aadc9

Please sign in to comment.