Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1783e8cade | ||
|
|
c7d6b21789 | ||
|
|
8d4e6498c3 | ||
|
|
9984f4fffd | ||
|
|
75a62c7a64 | ||
|
|
73eaadf6c3 | ||
|
|
292f6f1904 | ||
|
|
5a2947c9d0 | ||
|
|
fdea35a71b | ||
|
|
8f6eb196cd | ||
|
|
3b6e063599 | ||
|
|
015218f8c8 | ||
|
|
00d1d6d807 | ||
|
|
49c3cbfb4e | ||
|
|
925becfb15 | ||
|
|
2cebc52065 | ||
|
|
34e504bf93 | ||
|
|
f0649ce841 | ||
|
|
65af6a55b7 | ||
|
|
1326d3f0b8 | ||
|
|
b062b54626 | ||
|
|
9bee56cc67 | ||
|
|
9fb0180eb2 | ||
|
|
4f8af1a518 | ||
|
|
62b6048468 | ||
|
|
b6363c8100 | ||
|
|
db4cec8a6c | ||
|
|
4de6f4f616 | ||
|
|
7c53bb4bb1 | ||
|
|
115709e3c1 | ||
|
|
1e8dbf8212 | ||
|
|
1bfaab13ca | ||
|
|
083235d91f | ||
|
|
bc4e115b30 | ||
|
|
807763c85e | ||
|
|
69fa6c4b73 | ||
|
|
3141381c2e | ||
|
|
8f847437a9 | ||
|
|
487fcea6f4 | ||
|
|
63a31db0a3 | ||
|
|
575edecccb | ||
|
|
14adda8f6b | ||
|
|
7cacff6d61 | ||
|
|
4ced125239 | ||
|
|
ac94c81134 | ||
|
|
9501050ddc | ||
|
|
c688880f9e | ||
|
|
47ec404a52 |
No files matched your search
@@ -113,8 +113,8 @@ Miscellaneous
|
||||
* Matroska edition switching at runtime.
|
||||
* Support for playing URLs of popular streaming sites directly.
|
||||
(e.g. ``mpv https://www.youtube.com/watch?v=...``).
|
||||
Requires a recent version of ``youtube-dl`` to be installed, and
|
||||
``ytdl=yes`` in the mpv config file.
|
||||
Requires a recent version of ``youtube-dl`` to be installed. Can be
|
||||
disabled with ``ytdl=no`` in the mpv config file.
|
||||
* Support for precise scrolling which scales the parameter of commands. If the
|
||||
input doesn't support precise scrolling the scale factor stays 1.
|
||||
* Allow changing/adjusting video filters at runtime. (This is also used to make
|
||||
|
||||
@@ -426,20 +426,20 @@ Program Behavior
|
||||
Enable the youtube-dl hook-script. It will look at the input URL, and will
|
||||
play the video located on the website. This works with many streaming sites,
|
||||
not just the one the scripts are named after. This requires a recent version
|
||||
of youtube-dl to be installed on the system.
|
||||
of youtube-dl to be installed on the system. (Enabled by default.)
|
||||
|
||||
If the script can't do anything with an URL, it will do nothing.
|
||||
|
||||
Currently disabled by default, because youtube-dl's generic extractor can
|
||||
get stuck on some URL, preventing playback.
|
||||
|
||||
(Note: this is the replacement for the now removed libquvi support.)
|
||||
|
||||
``--ytdl-format=<best|worst|mp4|webm|...>``
|
||||
Video format/quality that is directly passed to youtube-dl. The possible
|
||||
values are specific to the website and the video, for a given url the
|
||||
available formats can be found with the command
|
||||
``youtube-dl --list-formats URL``.
|
||||
``youtube-dl --list-formats URL``. See youtube-dl's documentation for
|
||||
available aliases. To use experimental DASH support for youtube, use
|
||||
``bestvideo+bestaudio``.
|
||||
(Default: ``best``)
|
||||
|
||||
Video
|
||||
-----
|
||||
@@ -577,7 +577,7 @@ Video
|
||||
Disable scaling of the video. If the window is larger than the video,
|
||||
black bars are added. Otherwise, the video is cropped. The video still
|
||||
can be influenced by the other ``--video-...`` options. (If the
|
||||
``--video-zoom`` option is set to a value other than ``1``, scaling is
|
||||
``--video-zoom`` option is set to a value other than ``0``, scaling is
|
||||
enabled, but the video isn't automatically scaled to the window size.)
|
||||
|
||||
The video and monitor aspects aspect will be ignored. Aspect correction
|
||||
|
||||
@@ -1,3 +1,41 @@
|
||||
Release 0.7.2
|
||||
=============
|
||||
|
||||
Changes
|
||||
-------
|
||||
|
||||
- Give precedence to the DVD menu navigation keyboard bindings so that user
|
||||
defined LEFT/RIGHT/... bindings don't break DVD menu navigation.
|
||||
- Try to fallback to the "default" device if the selected device is busy in the
|
||||
alsa AO.
|
||||
- Don't create Dock icon for audio only files on OS X.
|
||||
- Save screenshots to desktop when using the app bundle on OS X.
|
||||
- Restore ab-loop settings with playback resume.
|
||||
- Bump required youtube-dl version to 2014.11.26 and enable the ytdl_hook Lua
|
||||
script by default (now playing videos from YouTube and the like will work
|
||||
out of the box without any configuration change needed).
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
|
||||
- Don't signal an error if --stream-dump is used.
|
||||
- Fix removing key bindings from Lua scripts.
|
||||
- Reject channel descriptions with too many channels in the coreaudio AO.
|
||||
- Don't async redraw when waiting for VO redraw on OS X (this fixes the very
|
||||
annoying glitch where the black bars disappear for a single frame when going
|
||||
fullscreen).
|
||||
- Fix mono playback with the also AO.
|
||||
- Don't crash if framebuffers are not available in the opengl VO.
|
||||
|
||||
New features
|
||||
------------
|
||||
|
||||
- Try to handle multi-arc videos in the ytdl_hook Lua script.
|
||||
|
||||
This listing is not complete. There are many more bug fixes and changes. The
|
||||
complete change log can be viewed by running ``git log 47ec404..c7d6b21`` in
|
||||
the git repository.
|
||||
|
||||
Release 0.7.1
|
||||
=============
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
screenshot-template=~/Desktop/shot%n
|
||||
@@ -280,8 +280,13 @@ static inline void update_ch(af_hrtf_t *s, short *in, const int k)
|
||||
}
|
||||
|
||||
/* We need to update the bass compensation delay line, too. */
|
||||
s->ba_l[k] = in[0] + in[4] + in[2];
|
||||
s->ba_r[k] = in[4] + in[1] + in[3];
|
||||
// TODO: should this use lf/cf/rf etc. instead?
|
||||
s->ba_l[k] = in[0];
|
||||
s->ba_r[k] = in[1];
|
||||
if (s->decode_mode == HRTF_MIX_51) {
|
||||
s->ba_l[k] += in[4] + in[2];
|
||||
s->ba_r[k] += in[4] + in[3];
|
||||
}
|
||||
}
|
||||
|
||||
static void clear_coeff(af_hrtf_t *s, float *c)
|
||||
|
||||
+9
-1
@@ -461,17 +461,22 @@ static int init(struct ao *ao)
|
||||
if (strcmp(device, "default") != 0)
|
||||
device = talloc_asprintf(ao, "plug:%s", device);
|
||||
}
|
||||
const char *old_dev = device;
|
||||
if (ao->device)
|
||||
device = ao->device;
|
||||
if (p->cfg_device && p->cfg_device[0])
|
||||
device = p->cfg_device;
|
||||
bool user_set_device = device != old_dev; // not strcmp()
|
||||
|
||||
MP_VERBOSE(ao, "using device: %s\n", device);
|
||||
MP_VERBOSE(ao, "using ALSA version: %s\n", snd_asoundlib_version());
|
||||
|
||||
err = try_open_device(ao, device, p->cfg_block ? 0 : SND_PCM_NONBLOCK);
|
||||
if (err < 0) {
|
||||
if (err != -EBUSY && !p->cfg_block) {
|
||||
if (err == -EBUSY && !user_set_device && strcmp(device, "default") != 0) {
|
||||
MP_WARN(ao, "Device '%s' busy, retrying default.\n", device);
|
||||
err = try_open_device(ao, "default", 0);
|
||||
} else if (err != -EBUSY && !p->cfg_block) {
|
||||
MP_WARN(ao, "Open in nonblock-mode "
|
||||
"failed, trying to open in block-mode.\n");
|
||||
err = try_open_device(ao, device, 0);
|
||||
@@ -630,6 +635,9 @@ static int init(struct ao *ao)
|
||||
MP_WARN(ao, "Got unknown channel map from ALSA.\n");
|
||||
}
|
||||
|
||||
if (ao->channels.num == 1)
|
||||
ao->channels.speaker[0] = MP_SP(FC);
|
||||
|
||||
free(alsa_chmap);
|
||||
}
|
||||
#endif
|
||||
|
||||
+26
-12
@@ -354,22 +354,28 @@ static void ca_log_layout(struct ao *ao, AudioChannelLayout *layout)
|
||||
|
||||
AudioChannelDescription *descs = layout->mChannelDescriptions;
|
||||
|
||||
MP_VERBOSE(ao, "layout: tag: <%d>, bitmap: <%d>, "
|
||||
"descriptions <%d>\n",
|
||||
layout->mChannelLayoutTag,
|
||||
layout->mChannelBitmap,
|
||||
layout->mNumberChannelDescriptions);
|
||||
MP_VERBOSE(ao, "layout: tag: <%u>, bitmap: <%u>, "
|
||||
"descriptions <%u>\n",
|
||||
(unsigned) layout->mChannelLayoutTag,
|
||||
(unsigned) layout->mChannelBitmap,
|
||||
(unsigned) layout->mNumberChannelDescriptions);
|
||||
|
||||
for (int i = 0; i < layout->mNumberChannelDescriptions; i++) {
|
||||
AudioChannelDescription d = descs[i];
|
||||
MP_VERBOSE(ao, " - description %d: label <%d, %d>, flags: <%u>, "
|
||||
"coords: <%f, %f, %f>\n", i,
|
||||
d.mChannelLabel,
|
||||
ca_label_to_mp_speaker_id(d.mChannelLabel),
|
||||
d.mChannelFlags,
|
||||
MP_VERBOSE(ao, " - description %d: label <%u, %u>, "
|
||||
" flags: <%u>, coords: <%f, %f, %f>\n", i,
|
||||
(unsigned) d.mChannelLabel,
|
||||
(unsigned) ca_label_to_mp_speaker_id(d.mChannelLabel),
|
||||
(unsigned) d.mChannelFlags,
|
||||
d.mCoordinates[0],
|
||||
d.mCoordinates[1],
|
||||
d.mCoordinates[2]);
|
||||
|
||||
if (i >= 32) {
|
||||
MP_VERBOSE(ao, " detected more than 32 channel descriptions, "
|
||||
"skipping output");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,14 +416,22 @@ bool ca_layout_to_mp_chmap(struct ao *ao, AudioChannelLayout *layout,
|
||||
// to the waveextensible definition: this is the kind of
|
||||
// descriptions we process here.
|
||||
|
||||
if (layout->mNumberChannelDescriptions > MP_NUM_CHANNELS) {
|
||||
MP_VERBOSE(ao, "layout has too many descriptions (%u, max: %d)\n",
|
||||
(unsigned) layout->mNumberChannelDescriptions,
|
||||
MP_NUM_CHANNELS);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int n = 0; n < layout->mNumberChannelDescriptions; n++) {
|
||||
AudioChannelLabel label = layout->mChannelDescriptions[n].mChannelLabel;
|
||||
uint8_t speaker = ca_label_to_mp_speaker_id(label);
|
||||
if (label == kAudioChannelLabel_Unknown)
|
||||
continue;
|
||||
if (speaker < 0) {
|
||||
MP_VERBOSE(ao, "channel label=%d unusable to build channel "
|
||||
"bitmap, skipping layout\n", label);
|
||||
MP_VERBOSE(ao, "channel label=%u unusable to build channel "
|
||||
"bitmap, skipping layout\n", (unsigned) label);
|
||||
goto coreaudio_error;
|
||||
} else {
|
||||
chmap->speaker[n] = speaker;
|
||||
chmap->num = n + 1;
|
||||
|
||||
@@ -286,6 +286,8 @@ static int lavf_check_file(demuxer_t *demuxer, enum demux_check check)
|
||||
.buf_size = 0,
|
||||
.buf = av_mallocz(PROBE_BUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE),
|
||||
};
|
||||
if (!avpd.buf)
|
||||
return -1;
|
||||
|
||||
bool final_probe = false;
|
||||
do {
|
||||
@@ -679,6 +681,8 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
|
||||
return -1;
|
||||
|
||||
avfc = avformat_alloc_context();
|
||||
if (!avfc)
|
||||
return -1;
|
||||
|
||||
if (lavfdopts->cryptokey)
|
||||
parse_cryptokey(avfc, lavfdopts->cryptokey);
|
||||
|
||||
@@ -345,6 +345,10 @@ static int demux_mkv_read_info(demuxer_t *demuxer)
|
||||
if (info.n_timecode_scale) {
|
||||
mkv_d->tc_scale = info.timecode_scale;
|
||||
MP_VERBOSE(demuxer, "| + timecode scale: %" PRIu64 "\n", mkv_d->tc_scale);
|
||||
if (mkv_d->tc_scale < 1 || mkv_d->tc_scale > INT_MAX) {
|
||||
res = -1;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if (info.n_duration) {
|
||||
mkv_d->duration = info.duration * mkv_d->tc_scale / 1e9;
|
||||
|
||||
+6
-3
@@ -445,6 +445,8 @@ static struct cmd_bind *find_any_bind_for_key(struct input_ctx *ictx,
|
||||
}
|
||||
if (s->flags & MP_INPUT_EXCLUSIVE)
|
||||
break;
|
||||
if (best_bind && (s->flags & MP_INPUT_ON_TOP))
|
||||
break;
|
||||
}
|
||||
|
||||
return best_bind;
|
||||
@@ -1019,14 +1021,15 @@ void mp_input_define_section(struct input_ctx *ictx, char *name, char *location,
|
||||
if (!name || !name[0])
|
||||
return; // parse_config() changes semantics with restrict_section==empty
|
||||
input_lock(ictx);
|
||||
// Delete:
|
||||
struct cmd_bind_section *bs = get_bind_section(ictx, bstr0(name));
|
||||
remove_binds(bs, builtin);
|
||||
if (contents) {
|
||||
// Redefine:
|
||||
parse_config(ictx, builtin, bstr0(contents), location, name);
|
||||
} else {
|
||||
// Disable:
|
||||
mp_input_disable_section(ictx, name);
|
||||
// Delete:
|
||||
struct cmd_bind_section *bs = get_bind_section(ictx, bstr0(name));
|
||||
remove_binds(bs, builtin);
|
||||
}
|
||||
input_unlock(ictx);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,16 @@ static void read_pipe_thread(struct mp_input_src *src, void *param)
|
||||
goto done;
|
||||
}
|
||||
|
||||
// If we're reading from stdin, unset it. All I/O on synchronous handles is
|
||||
// serialized, so stupid DLLs that call GetFileType on stdin can hang the
|
||||
// process if they do it while we're reading from it. At least, the
|
||||
// VirtualBox OpenGL ICD is affected by this, but only on Windows XP.
|
||||
// GetFileType works differently in later versions of Windows. See:
|
||||
// https://support.microsoft.com/kb/2009703
|
||||
// http://blogs.msdn.com/b/oldnewthing/archive/2011/12/02/10243553.aspx
|
||||
if ((void*)_get_osfhandle(fd) == GetStdHandle(STD_INPUT_HANDLE))
|
||||
SetStdHandle(STD_INPUT_HANDLE, NULL);
|
||||
|
||||
waio = waio_alloc((void *)_get_osfhandle(fd), 0, NULL, NULL);
|
||||
if (!waio) {
|
||||
MP_ERR(src, "Can't initialize win32 file reader.\n");
|
||||
|
||||
+1
-1
@@ -614,7 +614,7 @@ const struct MPOpts mp_default_opts = {
|
||||
.use_text_osd = 1,
|
||||
#if HAVE_LUA
|
||||
.lua_load_osc = 1,
|
||||
.lua_load_ytdl = 0,
|
||||
.lua_load_ytdl = 1,
|
||||
.lua_ytdl_format = NULL,
|
||||
#endif
|
||||
.auto_load_scripts = 1,
|
||||
|
||||
@@ -233,6 +233,8 @@ Application *mpv_shared_app(void)
|
||||
options:NSAnchoredSearch
|
||||
range:NSMakeRange(0, [MPV_PROTOCOL length])];
|
||||
|
||||
url = [url stringByRemovingPercentEncoding];
|
||||
|
||||
self.files = @[url];
|
||||
|
||||
if (self.willStopOnOpenEvent) {
|
||||
@@ -329,7 +331,10 @@ void init_cocoa_application(void)
|
||||
NSApp = mpv_shared_app();
|
||||
[NSApp setDelegate:NSApp];
|
||||
[NSApp initialize_menu];
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
|
||||
// Will be set to Regular from cocoa_common during UI creation so that we
|
||||
// don't create an icon when playing audio only files.
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
|
||||
|
||||
atexit_b(^{
|
||||
// Because activation policy has just been set to behave like a real
|
||||
@@ -439,21 +444,6 @@ static bool bundle_started_from_finder(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
static const char macosx_icon[] =
|
||||
#include "osdep/macosx_icon.inc"
|
||||
;
|
||||
|
||||
static void set_application_icon(NSApplication *app)
|
||||
{
|
||||
NSData *icon_data = [NSData dataWithBytesNoCopy:(void *)macosx_icon
|
||||
length:sizeof(macosx_icon)
|
||||
freeWhenDone:NO];
|
||||
NSImage *icon = [[NSImage alloc] initWithData:icon_data];
|
||||
[app setApplicationIconImage:icon];
|
||||
[icon release];
|
||||
[icon_data release];
|
||||
}
|
||||
|
||||
void macosx_finder_args_preinit(int *argc, char ***argv)
|
||||
{
|
||||
Application *app = mpv_shared_app();
|
||||
@@ -475,7 +465,6 @@ void macosx_finder_args_preinit(int *argc, char ***argv)
|
||||
*argc = cocoa_argc;
|
||||
*argv = cocoa_argv;
|
||||
} else {
|
||||
set_application_icon(app);
|
||||
for (int i = 0; i < *argc; i++ ) {
|
||||
NSString *arg = [NSString stringWithUTF8String:(*argv)[i]];
|
||||
[app.argumentsList addObject:arg];
|
||||
|
||||
+1
-1
@@ -4494,7 +4494,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
||||
char *sep = strchr(name, '/');
|
||||
char *target = NULL;
|
||||
char space[MAX_CLIENT_NAME];
|
||||
if (name) {
|
||||
if (sep) {
|
||||
snprintf(space, sizeof(space), "%.*s", (int)(sep - name), name);
|
||||
target = space;
|
||||
name = sep + 1;
|
||||
|
||||
@@ -243,6 +243,8 @@ static const char *const backup_properties[] = {
|
||||
"options/ass-use-margins",
|
||||
"options/ass-vsfilter-aspect-compat",
|
||||
"options/ass-style-override",
|
||||
"options/ab-loop-a",
|
||||
"options/ab-loop-b",
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
+2
-3
@@ -125,9 +125,8 @@ void mp_nav_init(struct MPContext *mpctx)
|
||||
|
||||
MP_VERBOSE(mpctx->nav_state, "enabling\n");
|
||||
|
||||
mp_input_enable_section(mpctx->input, "discnav", 0);
|
||||
mp_input_set_section_mouse_area(mpctx->input, "discnav-menu",
|
||||
INT_MIN, INT_MIN, INT_MAX, INT_MAX);
|
||||
mp_input_enable_section(mpctx->input, "discnav",
|
||||
MP_INPUT_ALLOW_VO_DRAGGING | MP_INPUT_ALLOW_HIDE_CURSOR);
|
||||
|
||||
update_state(mpctx);
|
||||
}
|
||||
|
||||
@@ -967,6 +967,7 @@ static void play_current_file(struct MPContext *mpctx)
|
||||
|
||||
if (opts->stream_dump && opts->stream_dump[0]) {
|
||||
stream_dump(mpctx);
|
||||
mpctx->error_playing = 1;
|
||||
goto terminate_playback;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1043,7 +1043,7 @@ static int script_input_enable_section(lua_State *L)
|
||||
} else if (bstr_equals0(val, "exclusive")) {
|
||||
flags |= MP_INPUT_EXCLUSIVE;
|
||||
} else {
|
||||
luaL_error(L, "invalid flag: '%.*s'", BSTR_P(val));
|
||||
luaL_error(L, "invalid flag");
|
||||
}
|
||||
}
|
||||
mp_input_enable_section(mpctx->input, section, flags);
|
||||
|
||||
+16
-3
@@ -1853,9 +1853,13 @@ function tick()
|
||||
end
|
||||
end
|
||||
|
||||
function do_enable_keybindings()
|
||||
mp.enable_key_bindings("showhide", "allow-vo-dragging|allow-hide-cursor")
|
||||
end
|
||||
|
||||
function enable_osc(enable)
|
||||
if enable then
|
||||
mp.enable_key_bindings("showhide")
|
||||
do_enable_keybindings()
|
||||
show_osc()
|
||||
else
|
||||
hide_osc()
|
||||
@@ -1876,12 +1880,21 @@ mp.observe_property("fullscreen", "bool", function(name, val) state.fullscreen =
|
||||
mp.observe_property("pause", "bool", pause_state)
|
||||
mp.observe_property("cache-idle", "bool", cache_state)
|
||||
|
||||
mp.observe_property("disc-menu-active", "bool", function(name, val)
|
||||
if val == true then
|
||||
hide_osc()
|
||||
mp.disable_key_bindings("showhide")
|
||||
else
|
||||
do_enable_keybindings()
|
||||
end
|
||||
end)
|
||||
|
||||
-- mouse show/hide bindings
|
||||
mp.set_key_bindings({
|
||||
{"mouse_move", function(e) process_event("mouse_move", nil) end},
|
||||
{"mouse_leave", mouse_leave},
|
||||
}, "showhide")
|
||||
mp.enable_key_bindings("showhide", "allow-vo-dragging|allow-hide-cursor")
|
||||
}, "showhide", "force")
|
||||
do_enable_keybindings()
|
||||
|
||||
--mouse input bindings
|
||||
mp.set_key_bindings({
|
||||
|
||||
+42
-15
@@ -3,7 +3,7 @@ local msg = require 'mp.msg'
|
||||
|
||||
local ytdl = {
|
||||
path = "youtube-dl",
|
||||
minver = "2014.11.09",
|
||||
minver = "2014.11.26",
|
||||
vercheck = nil,
|
||||
}
|
||||
|
||||
@@ -97,30 +97,57 @@ mp.add_hook("on_load", 10, function ()
|
||||
elseif not (json["_type"] == nil) and (json["_type"] == "playlist") then
|
||||
-- a playlist
|
||||
|
||||
local playlist = "#EXTM3U\n"
|
||||
for i, entry in pairs(json.entries) do
|
||||
local site = entry.url
|
||||
-- some funky guessing to detect multi-arc videos
|
||||
if not (json.entries[1]["webpage_url"] == nil)
|
||||
and (json.entries[1]["webpage_url"] == json["webpage_url"]) then
|
||||
msg.verbose("multi-arc video detected, building EDL")
|
||||
|
||||
-- some extractors will still return the full info for
|
||||
-- all clips in the playlist and the URL will point
|
||||
-- directly to the file in that case, which we don't
|
||||
-- want so get the webpage URL instead, which is what
|
||||
-- we want
|
||||
if not (entry["webpage_url"] == nil) then
|
||||
site = entry["webpage_url"]
|
||||
|
||||
local playlist = "edl://"
|
||||
for i, entry in pairs(json.entries) do
|
||||
|
||||
playlist = playlist .. entry.url .. ";"
|
||||
end
|
||||
|
||||
playlist = playlist .. "ytdl://" .. site .. "\n"
|
||||
end
|
||||
msg.debug("EDL: " .. playlist)
|
||||
|
||||
mp.set_property("stream-open-filename", "memory://" .. playlist)
|
||||
|
||||
mp.set_property("stream-open-filename", playlist)
|
||||
if not (json.title == nil) then
|
||||
mp.set_property("file-local-options/media-title", json.title)
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
local playlist = "#EXTM3U\n"
|
||||
for i, entry in pairs(json.entries) do
|
||||
local site = entry.url
|
||||
|
||||
-- some extractors will still return the full info for
|
||||
-- all clips in the playlist and the URL will point
|
||||
-- directly to the file in that case, which we don't
|
||||
-- want so get the webpage URL instead, which is what
|
||||
-- we want
|
||||
if not (entry["webpage_url"] == nil) then
|
||||
site = entry["webpage_url"]
|
||||
end
|
||||
|
||||
playlist = playlist .. "ytdl://" .. site .. "\n"
|
||||
end
|
||||
|
||||
mp.set_property("stream-open-filename", "memory://" .. playlist)
|
||||
end
|
||||
|
||||
else -- probably a video
|
||||
local streamurl = ""
|
||||
|
||||
-- DASH?
|
||||
if not (json["requested_formats"] == nil) then
|
||||
msg.info("NOTE: Using DASH, expect inaccurate duration.")
|
||||
msg.info("Using DASH, expect inaccurate duration.")
|
||||
if not (json.duration == nil) then
|
||||
msg.info("actual duration: " .. mp.format_time(json.duration))
|
||||
end
|
||||
|
||||
-- video url
|
||||
streamurl = json["requested_formats"][1].url
|
||||
|
||||
|
||||
+3
-4
@@ -127,8 +127,8 @@ void uninit_sub_renderer(struct MPContext *mpctx)
|
||||
static void init_sub_renderer(struct MPContext *mpctx) {}
|
||||
void uninit_sub_renderer(struct MPContext *mpctx) {}
|
||||
|
||||
void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts,
|
||||
struct mp_osd_res *dim) {}
|
||||
void mp_ass_configure_fonts(struct ass_renderer *a, struct MPOpts *b,
|
||||
struct mpv_global *c, struct mp_log *d) {}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -227,10 +227,9 @@ static void update_subtitle(struct MPContext *mpctx, int order)
|
||||
struct track *track = mpctx->current_track[order][STREAM_SUB];
|
||||
struct dec_sub *dec_sub = mpctx->d_sub[order];
|
||||
|
||||
if (!track)
|
||||
if (!track || !dec_sub)
|
||||
return;
|
||||
|
||||
assert(dec_sub);
|
||||
int obj = order ? OSDTYPE_SUB2 : OSDTYPE_SUB;
|
||||
|
||||
if (mpctx->d_video) {
|
||||
|
||||
@@ -243,11 +243,6 @@ static int control(stream_t *stream, int cmd, void *arg)
|
||||
{
|
||||
cdda_priv *p = stream->priv;
|
||||
switch (cmd) {
|
||||
case STREAM_CTRL_GET_NUM_TITLES:
|
||||
{
|
||||
*(unsigned int *)arg = p->cd->tracks;
|
||||
return STREAM_OK;
|
||||
}
|
||||
case STREAM_CTRL_GET_NUM_CHAPTERS:
|
||||
{
|
||||
int start_track = get_track_by_sector(p, p->start_sector);
|
||||
|
||||
+14
-9
@@ -353,6 +353,8 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
|
||||
ctx->hwdec_fmt = 0;
|
||||
ctx->avctx = avcodec_alloc_context3(lavc_codec);
|
||||
AVCodecContext *avctx = ctx->avctx;
|
||||
if (!ctx->avctx)
|
||||
goto error;
|
||||
avctx->bit_rate = 0;
|
||||
avctx->opaque = vd;
|
||||
avctx->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
@@ -360,15 +362,15 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
|
||||
|
||||
avctx->refcounted_frames = 1;
|
||||
ctx->pic = av_frame_alloc();
|
||||
if (!ctx->pic)
|
||||
goto error;
|
||||
|
||||
if (ctx->hwdec) {
|
||||
avctx->thread_count = 1;
|
||||
avctx->get_format = get_format_hwdec;
|
||||
avctx->get_buffer2 = get_buffer2_hwdec;
|
||||
if (ctx->hwdec->init(ctx) < 0) {
|
||||
uninit_avctx(vd);
|
||||
return;
|
||||
}
|
||||
if (ctx->hwdec->init(ctx) < 0)
|
||||
goto error;
|
||||
} else {
|
||||
mp_set_avcodec_threads(avctx, lavc_param->threads);
|
||||
}
|
||||
@@ -418,11 +420,14 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
|
||||
mp_copy_lav_codec_headers(avctx, sh->lav_headers);
|
||||
|
||||
/* open it */
|
||||
if (avcodec_open2(avctx, lavc_codec, NULL) < 0) {
|
||||
MP_ERR(vd, "Could not open codec.\n");
|
||||
uninit_avctx(vd);
|
||||
return;
|
||||
}
|
||||
if (avcodec_open2(avctx, lavc_codec, NULL) < 0)
|
||||
goto error;
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
MP_ERR(vd, "Could not open codec.\n");
|
||||
uninit_avctx(vd);
|
||||
}
|
||||
|
||||
static void uninit_avctx(struct dec_video *vd)
|
||||
|
||||
@@ -734,6 +734,8 @@ struct AVFrame *mp_image_to_av_frame_and_unref(struct mp_image *img)
|
||||
void *ptr = new_ref->planes[n];
|
||||
size_t size = new_ref->stride[n] * new_ref->h;
|
||||
frame->buf[n] = av_buffer_create(ptr, size, free_img, dummy_ref, flags);
|
||||
if (!frame->buf[n])
|
||||
abort();
|
||||
}
|
||||
talloc_free(new_ref);
|
||||
return frame;
|
||||
|
||||
@@ -144,6 +144,22 @@ static void disable_power_management(struct vo *vo)
|
||||
&s->power_mgmt_assertion);
|
||||
}
|
||||
|
||||
static const char macosx_icon[] =
|
||||
#include "osdep/macosx_icon.inc"
|
||||
;
|
||||
|
||||
static void set_application_icon(NSApplication *app)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSData *icon_data = [NSData dataWithBytesNoCopy:(void *)macosx_icon
|
||||
length:sizeof(macosx_icon)
|
||||
freeWhenDone:NO];
|
||||
NSImage *icon = [[NSImage alloc] initWithData:icon_data];
|
||||
[app setApplicationIconImage:icon];
|
||||
[icon release];
|
||||
[pool release];
|
||||
}
|
||||
|
||||
int vo_cocoa_init(struct vo *vo)
|
||||
{
|
||||
struct vo_cocoa_state *s = talloc_zero(vo, struct vo_cocoa_state);
|
||||
@@ -195,7 +211,10 @@ void vo_cocoa_uninit(struct vo *vo)
|
||||
[s->gl_ctx release];
|
||||
[s->view removeFromSuperview];
|
||||
[s->view release];
|
||||
if (s->window) [s->window release];
|
||||
if (s->window) {
|
||||
[s->window release];
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -453,6 +472,9 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t flags, void *gl_ctx)
|
||||
// reconfiguration code.
|
||||
s->pending_events |= VO_EVENT_RESIZE;
|
||||
});
|
||||
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
set_application_icon(NSApp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -731,7 +753,9 @@ void *vo_cocoa_cgl_pixel_format(struct vo *vo)
|
||||
@synthesize vout = _video_output;
|
||||
|
||||
- (void)performAsyncResize:(NSSize)size {
|
||||
vo_cocoa_resize_redraw(self.vout, size.width, size.height);
|
||||
struct vo_cocoa_state *s = self.vout->cocoa;
|
||||
if (!s->waiting_frame)
|
||||
vo_cocoa_resize_redraw(self.vout, size.width, size.height);
|
||||
}
|
||||
|
||||
- (BOOL)keyboardEnabled {
|
||||
|
||||
@@ -91,7 +91,8 @@ void mp_compute_weights(struct filter_kernel *filter, double f, float *out_w)
|
||||
double sum = 0;
|
||||
for (int n = 0; n < filter->size; n++) {
|
||||
double x = f - (n - filter->size / 2 + 1);
|
||||
double w = filter->weight(filter, fabs(x) / filter->inv_scale);
|
||||
double c = fabs(x) / filter->inv_scale;
|
||||
double w = c <= filter->radius ? filter->weight(filter, c) : 0;
|
||||
out_w[n] = w;
|
||||
sum += w;
|
||||
}
|
||||
|
||||
@@ -141,6 +141,11 @@ static bool is_software_gl(GL *gl)
|
||||
strcmp(renderer, "Mesa X11") == 0;
|
||||
}
|
||||
|
||||
static void GLAPIENTRY dummy_glBindFramebuffer(GLenum target, GLuint framebuffer)
|
||||
{
|
||||
assert(framebuffer == 0);
|
||||
}
|
||||
|
||||
#define FN_OFFS(name) offsetof(GL, name)
|
||||
|
||||
#define DEF_FN(name) {FN_OFFS(name), {"gl" # name}}
|
||||
@@ -618,6 +623,10 @@ void mpgl_load_functions(GL *gl, void *(*getProcAddress)(const GLubyte *),
|
||||
|
||||
mp_verbose(log, "Detected OpenGL features:");
|
||||
list_features(gl->mpgl_caps, log, MSGL_V, false);
|
||||
|
||||
// Provided for simpler handling if no framebuffer support is available.
|
||||
if (!gl->BindFramebuffer)
|
||||
gl->BindFramebuffer = &dummy_glBindFramebuffer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+13
-5
@@ -152,7 +152,7 @@ static int find_depth_from_visuals(struct vo *vo, Visual ** visual_return)
|
||||
return bestvisual_depth;
|
||||
}
|
||||
|
||||
static void getMyXImage(struct priv *p, int foo)
|
||||
static bool getMyXImage(struct priv *p, int foo)
|
||||
{
|
||||
struct vo *vo = p->vo;
|
||||
#if HAVE_SHM && HAVE_XEXT
|
||||
@@ -212,6 +212,10 @@ shmemerror:
|
||||
p->myximage[foo] =
|
||||
XCreateImage(vo->x11->display, p->vinfo.visual, p->depth, ZPixmap,
|
||||
0, NULL, p->image_width, p->image_height, 8, 0);
|
||||
if (!p->myximage[foo]) {
|
||||
MP_WARN(vo, "could not allocate image");
|
||||
return false;
|
||||
}
|
||||
size_t sz = p->myximage[foo]->bytes_per_line * p->image_height + 32;
|
||||
p->ImageDataOrig[foo] = calloc(1, sz);
|
||||
p->myximage[foo]->data = p->ImageDataOrig[foo] + 16
|
||||
@@ -220,6 +224,7 @@ shmemerror:
|
||||
#if HAVE_SHM && HAVE_XEXT
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
static void freeMyXImage(struct priv *p, int foo)
|
||||
@@ -342,8 +347,10 @@ static bool resize(struct vo *vo)
|
||||
p->image_height = p->dst_h;
|
||||
|
||||
p->num_buffers = 2;
|
||||
for (int i = 0; i < p->num_buffers; i++)
|
||||
getMyXImage(p, i);
|
||||
for (int i = 0; i < p->num_buffers; i++) {
|
||||
if (!getMyXImage(p, i))
|
||||
return -1;
|
||||
}
|
||||
|
||||
const struct fmt2Xfmtentry_s *fmte = fmt2Xfmt;
|
||||
while (fmte->mpfmt) {
|
||||
@@ -615,7 +622,8 @@ static int control(struct vo *vo, uint32_t request, void *data)
|
||||
case VOCTRL_GET_PANSCAN:
|
||||
return VO_TRUE;
|
||||
case VOCTRL_SET_PANSCAN:
|
||||
resize(vo);
|
||||
if (vo->config_ok)
|
||||
resize(vo);
|
||||
return VO_TRUE;
|
||||
case VOCTRL_REDRAW_FRAME:
|
||||
draw_image(vo, p->original_image);
|
||||
@@ -629,7 +637,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
|
||||
|
||||
int events = 0;
|
||||
int r = vo_x11_control(vo, &events, request, data);
|
||||
if (events & (VO_EVENT_EXPOSE | VO_EVENT_RESIZE))
|
||||
if (vo->config_ok && (events & (VO_EVENT_EXPOSE | VO_EVENT_RESIZE)))
|
||||
resize(vo);
|
||||
vo_event(vo, events);
|
||||
return r;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <assert.h>
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <initguid.h>
|
||||
#include <ole2.h>
|
||||
|
||||
#include "options/options.h"
|
||||
|
||||
@@ -31,14 +31,14 @@ def __add_generic_flags__(ctx):
|
||||
def __add_gcc_flags__(ctx):
|
||||
ctx.env.CFLAGS += ["-Wall", "-Wundef", "-Wmissing-prototypes", "-Wshadow",
|
||||
"-Wno-switch", "-Wno-parentheses", "-Wpointer-arith",
|
||||
"-Wredundant-decls", "-Wno-pointer-sign",
|
||||
"-Werror=implicit-function-declaration",
|
||||
"-Wno-error=deprecated-declarations",
|
||||
"-Wno-error=unused-function" ]
|
||||
__test_and_add_flags__(ctx, ["-Wempty-body"])
|
||||
__test_and_add_flags__(ctx, ["-Wdisabled-optimization"])
|
||||
__test_and_add_flags__(ctx, ["-Wstrict-prototypes"])
|
||||
__test_and_add_flags__(ctx, ["-Wno-format-zero-length"])
|
||||
"-Wredundant-decls", "-Wno-pointer-sign"]
|
||||
__test_and_add_flags__(ctx, ["-Werror=implicit-function-declaration",
|
||||
"-Wno-error=deprecated-declarations",
|
||||
"-Wno-error=unused-function",
|
||||
"-Wempty-body",
|
||||
"-Wdisabled-optimization",
|
||||
"-Wstrict-prototypes",
|
||||
"-Wno-format-zero-length"])
|
||||
|
||||
def __add_clang_flags__(ctx):
|
||||
ctx.env.CFLAGS += ["-Wno-logical-op-parentheses", "-fcolor-diagnostics",
|
||||
|
||||
Reference in new issue
Block a user