Compare commits

..
48 Commits
Author SHA1 Message Date
Alessandro Ghedini 1783e8cade Release 0.7.2 2014-12-20 12:00:13 +01:00
wm4 c7d6b21789 options: enable --ytdl by default
Let's see who complains...
2014-12-19 19:23:28 +01:00
ChrisK2 8d4e6498c3 ytdl: bump requrired youtube-dl version to 2014.11.26 2014-12-19 19:23:22 +01:00
ChrisK2 9984f4fffd ytdl: Try to handle multi-arc videos
this currently uses a sketchy but apparently working workaround,
which will be removed once the neccessary changes in youtube-dl
are implemented

Fixes #1277
2014-12-19 19:23:15 +01:00
ChrisK2 75a62c7a64 ytdl: When using DASH, print actual duration
prints the actual duration as reported by youtube-dl to the
terminal when available
2014-12-19 19:23:11 +01:00
wm4 73eaadf6c3 vo_opengl: clamp filters to their size
This gives better results with fancy-downscaling. The issue here is that
fancy-downscalign "extends" the filter radius by some amount, which
requires using a larger filter size and shader. Then most of the filter
is "unused", but some filters still return non-0 coefficients, which
create heavy artifacts. Just clamp them off.

I'm not sure if this is the right solution, but at least it's better
than before.
2014-12-19 19:23:07 +01:00
Stefano Pigozzi 292f6f1904 cocoa: don't change app activation policy in libmpv
/cc @mpv-player/stable
2014-12-17 20:15:38 +01:00
Stefano Pigozzi 5a2947c9d0 cocoa: remove urlencoding for url open events
This fixes using the mpv:// custom protocol on Yosemite were apparently
we receive an url which is automatically urlencoded by the system.

/cc mpv-player/stable
2014-12-17 20:15:07 +01:00
Stefano Pigozzi fdea35a71b ao_coreaudio: add missing goto for error path 2014-12-17 20:13:23 +01:00
wm4 8f6eb196cd build: require alsa libs not older than 6 years
Some IEC958 flags we use have been introduced in 2008, which makes
compilation fail on older systems.
2014-12-17 20:12:44 +01:00
wm4 3b6e063599 vo_x11: don't attempt to resize when unconfigured
Fixes #1347.

The previous commit actually fixes the crash.
2014-12-17 20:12:06 +01:00
wm4 015218f8c8 vo_x11: check allocation errors
Avoids a crash if allocation fails.
2014-12-17 20:11:41 +01:00
wm4 00d1d6d807 build: add checks for some compiler warning flags 2014-12-17 20:11:30 +01:00
wm4 49c3cbfb4e vd_lavc: fix error handling path
The ctx->pic check must uninitialize the decoder.
2014-12-17 20:11:12 +01:00
wm4 925becfb15 mp_image: check for malloc failure
Or rather, the only reason av_buffer_create() can fail is a malloc
failure.
2014-12-17 20:11:03 +01:00
wm4 2cebc52065 stream_cdda: don't return number of tracks as number of titles
Apparently, we treat different tracks as titles, so returning the number
of titles (which is user-visible as "disc-titles" property) is
completely misguided.
2014-12-17 20:10:54 +01:00
wm4 34e504bf93 Check some mallocs
Fixes #1337.
2014-12-17 20:09:24 +01:00
James Ross-Gowan f0649ce841 pipe-win32: possible fix for Windows XP deadlock
This fixes a hang with the VirtualBox OpenGL drivers. It might help
with #1325 as well.
2014-12-17 20:09:05 +01:00
wm4 65af6a55b7 manpage: fix mistake in --video-zoom mention
Fixes #1331.
2014-12-17 20:08:48 +01:00
wm4 1326d3f0b8 command: fix crash with some forms of script_binding
"script_binding name ..." just crashed it. Oops.
2014-12-17 20:08:15 +01:00
wm4 b062b54626 vo_opengl: fix linkage type
Can happen on Windows, I suppose.
2014-12-17 20:06:05 +01:00
wm4 9bee56cc67 vo_opengl: don't crash if framebuffers are not available
In theory, vo_opengl supports operation without framebuffers. But this
has been broken for a while now (commit cc00b3ff is a contender). It
crashed because it unconditionally called gl->BindFramebuffer() (which
is NULL if framebuffers are missing).

Since this function is actually only called to set the default
framebuffer, the simplest way to deal with this is to provide a dummy
function, insteas of uglifying the code with additional if branches.
2014-12-17 20:05:46 +01:00
James Ross-Gowan 9fb0180eb2 w32_common: fix GUID linking in Cygwin 2014-12-17 20:05:07 +01:00
wm4 4f8af1a518 player: restore ab-loop settings with playback resume
Fixes #1324.
2014-12-17 20:05:01 +01:00
wm4 62b6048468 build: fix --disable-libass
Still supported, but obviously untested.

You shouldn't use this option anyway.
2014-12-17 20:04:02 +01:00
ChrisK2 b6363c8100 DOCS: Improve documentation of --ytdl-format option
As suggested in #1321
2014-12-08 00:06:41 +01:00
wm4 db4cec8a6c sub: remove assertion
This should clearly be impossible, but it seems to happen with ordered
chapters for a user.

Since I can't tell what the actual bug is and it seems impossible to
know the details without downloading possibly huge files, this is
probably the best we can do.

Should at least partially fix #1319.
2014-12-08 00:06:17 +01:00
reimar 4de6f4f616 af_hrtf: Fix out-of-range read.
Based on patch by Yuriy Kaminskiy [yumkam gmail].

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@37330 b3059339-0415-0410-9bf9-f77b7e298cf2
Signed-off-by: wm4 <wm4@nowhere>
2014-12-08 00:04:42 +01:00
wm4 7c53bb4bb1 demux_mkv: reject 0 TimecodeScale
Also reject anything over INT_MAX; no particular reason for this upper
bound.

Fixes #1317.
2014-12-08 00:04:27 +01:00
Stefano Pigozzi 115709e3c1 cocoa: save screenshots to desktop when using app bundle
Fixes #947
2014-12-08 00:03:39 +01:00
Stefano Pigozzi 1e8dbf8212 cocoa: don't create Dock icon for audio only files
fixes #635
2014-12-08 00:03:34 +01:00
wm4 1bfaab13ca ao_alsa: hackfix mono playback
ALSA returns "FL" as channel layout when trying to play mono. mpv and
libavresample don't like this; in particular, using libavresample to
convert stereo to "FL" fails.
2014-12-08 00:02:45 +01:00
wm4 083235d91f osc, dvd, bd: fix mouse state when changing menu modes
The flags weren't correctly set, and the mouse cursor remained visible
after leaving menu mode.

This was apparently broken in 0.7.0 too.

Fixes #1316.
2014-12-08 00:02:24 +01:00
wm4 bc4e115b30 discnav: remove redundant call
This was made the default a while ago.
2014-12-08 00:02:16 +01:00
Stefano Pigozzi 807763c85e coreaudio: don't output too many channel descriptions
for #1279 and #1249
2014-12-07 23:59:33 +01:00
Stefano Pigozzi 69fa6c4b73 coreaudio: add missing \n in log line 2014-12-07 23:59:23 +01:00
Stefano Pigozzi 3141381c2e coreaudio: don't print layout a second time
For #1279
2014-12-07 23:59:16 +01:00
Stefano Pigozzi 8f847437a9 cocoa: don't async redraw when waiting for VO redraw
This fixes the very annoying glitch where the black bars disappear for
a single frame when going fullscreen.
2014-12-07 23:59:02 +01:00
wm4 487fcea6f4 ao_alsa: try to fallback to "default" device if device is busy
ALSA is crap. It's impossible to make multichannel playback just do the
right thing. dmix (the default on most distros) can do stereo only, and
will refuse to play multichannel. On the other hand, if you try like mpv
(and mplayer) to open a multichannel device (like "surround51" etc.),
this will actually open a hardware device, which will either fail if
dmix is active, or block out dmix if opening succeeds.

This commit falls back to "default" (i.e. dmix) if opening a
multichannel device fails, which is a tiny step towards the right
behavior. (Although fixing it fully is impossible.)
2014-12-07 23:57:34 +01:00
wm4 63a31db0a3 input: add a hack to fix keyboard navigation with dvd/bd menu
If the user has LEFT/RIGHT/etc. bound in his input.conf, then these were
overriding the menu keys in dvdnav mode.

This hack works because the dvdnav crap happens to be the only user of
MP_INPUT_ON_TOP. If it finds a default key binding in the dvdnav menu
section, it will use that, instead of continuing search and possibly
finding the user key bindings meant for normal playback.
2014-12-07 23:56:25 +01:00
Stefano Pigozzi 575edecccb coreaudio: reject descriptions with too many channels
This is a fix attempt for #1279 and #1249.
2014-12-07 23:55:28 +01:00
Stefano Pigozzi 14adda8f6b coreaudio: fix more layout prints 2014-12-07 23:55:08 +01:00
Stefano Pigozzi 7cacff6d61 coreaudio: fix prints of uint32_t in log_layout 2014-12-07 23:54:22 +01:00
wm4 4ced125239 dvd, bd, osc: disable OSC while a menu is active
They interfere.

It turns out that commit b6ca4a48 actually broke this in weird ways, but
this solution is better anyway.
2014-12-07 23:54:12 +01:00
wm4 ac94c81134 input, lua: make removing key bindings work
This just kept adding bindings to the input section, rather than
defining it. One bad effect was that mp.remove_key_binding() in Lua
didn't work.
2014-12-07 23:52:33 +01:00
wm4 9501050ddc osc: always force mouse_move binding
So the OSC will still appear when using --no-input-default-bindings. It
also means it may override a user's mouse_move binding, but I guess
users who don't want the OSC should just use the --no-osc option.
2014-12-07 23:50:41 +01:00
wm4 c688880f9e lua: fix broken error message
luaL_error() doesn't support %.*s, because it uses Lua's own format
string mechanism that just looks like the C one. Just drop this part.
2014-12-07 23:50:13 +01:00
wm4 47ec404a52 player: don't signal an error if --stream-dump is used
The player thinks an error happened because no audio or video was played
after finishing the file, but this obviously makes no sense with stream
dumping. (error_playing follows the client API convention that negative
values are errors.)
2014-12-07 23:49:55 +01:00
32 changed files with 265 additions and 103 deletions

No files matched your search

+2 -2
View File
@@ -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
+6 -6
View File
@@ -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
+38
View File
@@ -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
+1 -1
View File
@@ -1 +1 @@
0.7.1
0.7.2
+7 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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;
+4
View File
@@ -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);
+4
View File
@@ -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
View File
@@ -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);
}
+10
View File
@@ -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
View File
@@ -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,
+6 -17
View File
@@ -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
View File
@@ -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;
+2
View File
@@ -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
View File
@@ -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);
}
+1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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) {
-5
View File
@@ -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
View File
@@ -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)
+2
View File
@@ -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;
+26 -2
View File
@@ -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 {
+2 -1
View File
@@ -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;
}
+9
View File
@@ -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
View File
@@ -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;
+1
View File
@@ -22,6 +22,7 @@
#include <assert.h>
#include <windows.h>
#include <windowsx.h>
#include <initguid.h>
#include <ole2.h>
#include "options/options.h"
+8 -8
View File
@@ -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",
+1 -1
View File
@@ -539,7 +539,7 @@ audio_output_features = [
}, {
'name': '--alsa',
'desc': 'ALSA audio output',
'func': check_pkg_config('alsa'),
'func': check_pkg_config('alsa >= 1.0.18'),
}, {
'name': '--coreaudio',
'desc': 'CoreAudio audio output',