Commit Graph

40682 Commits

Author SHA1 Message Date
wm4 7031335886 manpage: improve --osd-fractions description 2015-03-03 11:12:11 +01:00
wm4 fa65d657d2 manpage: remove empty line to fix formatting
The HTML rendering of this page formats the ``timeout`` section
differently, and we suspect it's because of this. (Or in other words:
wtf rst??)
2015-03-02 19:09:51 +01:00
wm4 89bc2975e9 audio: change playback speed directly in resampler
Although the libraries we use for resampling (libavresample and
libswresample) do not support changing sampelrate on the fly, this makes
it easier to make sure no audio buffers are implicitly dropped. In fact,
this commit adds additional code to drain the resampler explicitly.

Changing speed twice without feeding audio in-between made it crash
with libavresample inc ertain cases (libswresample is fine). This is
probably a libavresample bug. Hopefully this will be fixed, and also I
attempted to workaround the situation that crashes it. (It seems to
point in direction of random memory corruption, though.)
2015-03-02 19:09:44 +01:00
wm4 d0fee0ac33 demux_lavf: use this for image formats
Use the (relatively new) libavformat image format probing functionality,
instead of letting demux_mf guess by file extension and MIME type.

The libavformat support is weird, though. Traditionally, it uses an
absolutely terrible hack to detect images by extension, _and_ (which is
the horrible part) will randomly interpret parts of the filename as
specifiers for matching by number. So something like '%03d' will be
interpreted as placeholder for a frame number. The worst part is that
such character sequences can be perfectly valid and common in http URLs.
This is known as "image2" demuxer. The newer support, which probes by
examining the file header, is split into several format-specific
demuxers with names ending in "_pipe". So we check for such a name
suffix. (At this point we're doing fine-grained hacking around ffmpeg
weirdness, so a clean solution is impossible anyway until upstream
changes.)
2015-03-02 19:09:40 +01:00
wm4 a4b6bf8c41 player: refine rar:// playlist-safety handling
It was possible to make the player play local files by putting rar://
links into remote playlists, and some other potentially unsafe things.

Redo the handling of it. Now the rar-redirector (the thing in
demux_playlist.c) sets disable_safety, which makes the player open any
playlist entries returned. This is fine, because it redirects to the
same file anyway (just with different selection/interpretation of the
contents). On the other hand, rar:// itself is now considered fully
unsafe, which means that it is ignored if found in normal playlists.
2015-03-02 19:09:36 +01:00
wm4 01b87e509c msg: use relaxed atomics for log level test
This should be sufficient.

If stdatomic.h is not available, we make no difference.
2015-03-02 19:09:31 +01:00
wm4 445b3fbf82 buid: readd -Wparentheses
This warning wasn't overly helpful in the past, and warned against
perfectly fine code. But at least with recent gcc versions, this is the
warning that complains about assignments in if expressions (why???), so
we want to enable it.

Also change all the code this warning complains about for no reason.
2015-03-02 19:09:25 +01:00
wm4 4b177bd5c2 vo_direct3d: support NV12 with shaders
Semi-important, because --hwdec=dxva2 outputs NV12, and we really don't
want people to end up with the "old" StretchRect method.

Unfortunately, I couldn't actually get it to work. It seems most D3D
drivers (including the wine D3D implementation) reject D3DFMT_A8L8,
and I could not find any other 2-channel 8 bit Direct3D 9 format. It
seems newer D3D APIs have DXGI_FORMAT_R8G8_UNORM, but there's no way
to get it in D3D9.

Still pushing this; maybe it actually works on some drivers.
2015-03-02 19:09:18 +01:00
wm4 08199a64d2 vf_scale: libswscale is being stupid
This time (there are a lot of times), libswscale randomly ignores
brightness/saturation/contrast settings.

Looking at MPlayer code, it appears the return value of
sws_setColorspaceDetails() signals if changing these settings is
supported at all.

(Nevermind that supporting this feature has almost 0 value, and
obviously eats maintenance time.)
2015-03-01 22:32:38 +01:00
torque 1bbf1eb3ce Lua: add mp.get_screen_margins().
When used with mp.get_screen_size(), mp.get_screen_margins() allows a
Lua script to determine what portion of the mpv window actually has the
video in it.
2015-03-01 13:08:39 +01:00
Niklas Haas a76cc1dafc
Revert "Revert recent vo_opengl related commits"
Omitted a simple, but devastasting check. Fixed the relevant commits
now.

This reverts commit 8d24e9d9b8.

diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 9c8a643..f1ea03e 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -1034,9 +1034,9 @@ static void compile_shaders(struct gl_video *p)
     shader_def_opt(&header_conv, "USE_CONV_GAMMA", use_conv_gamma);
     shader_def_opt(&header_conv, "USE_CONST_LUMA", use_const_luma);
     shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_BT1886",
-                   gamma_fun == MP_CSP_TRC_BT_1886);
+                   use_linear_light && gamma_fun == MP_CSP_TRC_BT_1886);
     shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_SRGB",
-                   gamma_fun == MP_CSP_TRC_SRGB);
+                   use_linear_light && gamma_fun == MP_CSP_TRC_SRGB);
     shader_def_opt(&header_conv, "USE_SIGMOID", use_sigmoid);
     if (p->opts.alpha_mode > 0 && p->has_alpha && p->plane_count > 3)
         shader_def(&header_conv, "USE_ALPHA_PLANE", "3");
2015-02-28 20:23:47 +01:00
wm4 8d24e9d9b8 Revert recent vo_opengl related commits
Breaks vo_opengl by default. I'm hot able to fix this myself, because I
have no clue about the overcomplicated color management logic. Also,
whilethis is apparently caused by commit fbacd5, the following commits
all depend on it, so revert them too.

This reverts the following commits:
 e141caa97d
 653b0dd529
 729c8b3f64
 fbacd5de31

Fixes #1636.
2015-02-28 19:29:03 +01:00
wm4 833ac3f264 video: fix typo
Pointed out in #1636.
2015-02-28 18:37:14 +01:00
Oliver Freyermuth 40c9e79068 stream_dvb: Always define NO_STREAM_ID_FILTER if missing.
It is also used for initialization in channel-list setup.
Should fix compilation on FreeBSD, and is more correct
since it is used unconditionally.
Reverts 6445648 .
2015-02-28 18:27:21 +01:00
Stefano Pigozzi 03a69bac95 cocoa: remove the setNextKeyView hack
Just use makeFirstResponder on the mpv events view from client code
if you need the built in keyboard events (this is easier for dealing with view
nesting).
2015-02-28 14:55:32 +01:00
Stefano Pigozzi 721e430cd2 examples/cocoabasic: allow to send stop command 2015-02-28 14:19:26 +01:00
zymos b742384162 manpage: fix typo
Signed-off-by: wm4 <wm4@nowhere>
2015-02-28 12:57:54 +01:00
Niklas Haas e141caa97d
vd_lavc: respect lavc's color_trc field
We now actually use the TRC tagging information lavc provides us with,
instead of always manually guessing.
2015-02-28 01:42:04 +01:00
Niklas Haas 653b0dd529
screenshots: check for AVFrame csp support
Apparently, libav stable is old enough to not have these fields.
2015-02-28 01:39:31 +01:00
Niklas Haas 729c8b3f64
screenshots: add support for csp tagging
This relies on upstream support in lavc, and will hence basically not
work at all. The intent is to get support for writing this information
into ffmpeg's PNG encoders etc.
2015-02-28 01:08:32 +01:00
Niklas Haas fbacd5de31 csputils: add missing gamma support
We have MP_CSP_TRC defined, but it wasn't being used by practically
anything. This commit adds missing conversion logic, adds it to
mp_image, and moves the auto-guessing logic to where it should be, in
mp_image_params_guess_csp (and out of vo_opengl).

Note that this also fixes a minor bug: csp_prim was not being copied
between mp_image structs if the format was not YUV in both cases, but
this is wrong - the primaries are always relevant.
2015-02-28 01:07:35 +01:00
Niklas Haas 076b3d1385 csputils: add support for BT.470-M
For some kind of legacy TV system, who knows? But ffmpeg supports it,
and it's cheap for us to add.
2015-02-28 01:07:09 +01:00
wm4 73c5c3df53 vo_opengl: delete 16 bit test texture
Essentially a leak, but not that bad since it's small and allocated only
once.
2015-02-27 22:13:15 +01:00
wm4 e7b7a5a476 vo_opengl: fix some comments 2015-02-27 22:01:27 +01:00
wm4 fbf76da913 stream: remove stream filter concept
Unused since the previous commit. (Apparently it was a stupid idea.)
2015-02-27 19:51:14 +01:00
wm4 5824eb7107 stream_rar: treat rar files as playlists
Refactors an older hack, which for some reason used a more complicated
way. This generates the playlist representing the contents of the rar
file in demux_playlist.c. The pseudo-demuxer could easily be separate
from the the playlist parsers (and in fact there's almost no shared
code), but I don't think this obscure feature deserves a separate file.

Sample files created with:

    rar a -v20000k -m0 files.rar file1.mkv file1.mkv
2015-02-27 19:44:39 +01:00
wm4 64456488b3 build: improve DVB check
A use of NO_STREAM_ID_FILTER was added to the DVB code recently. While I
have no idea what it's needed for, it makes mpv fail to compile on
FreeBSD 10.1. Add it to the dvb configure check.
2015-02-27 18:52:53 +01:00
wm4 1eb533afb3 options: handle choice -> flag fallback automatically
In the past it happened quite often that flag options (yes/no) were
changed to choice options (yes/no/some more). The problem with this was
that while flag options don't need a parameter, this wasn't the case
with choice options. A hack was introduced to compensate for this:
setting M_OPT_OPTIONAL_PARAM on the option, and an empty string ("") was
added as choice, so that the choice could be used like a flag. So, for
example, "--mute" would set the choice "".

Fix this by 1. not requiring a parameter if there's a "yes" choice, and
2. redirect an empty parameter to "yes". The effect is that a choice
option with the choices ["yes", "no"] is pretty much equivalent to a
flag option.
2015-02-27 18:31:24 +01:00
wm4 b143102f6d options: minor simplification in flag option parser 2015-02-27 18:17:46 +01:00
wm4 b7bb0de1d9 demux: bump default demuxer queue sizes
Now that we have fast stream switching, we can bump these sizes, as the
queues cause no delay in switching anymore.

Of course, the fast stream switching works for mkv and mp4 only. Other
formats will incur a quite terrible delay especially in network mode,
which this commit changes to 10 seconds. Let's see if someone
complains...
2015-02-27 12:44:40 +01:00
wm4 d896f043e4 client API: make some more properties observable
A/V sync things.
2015-02-27 12:24:04 +01:00
Niklas Haas 0f99b302f5
manpage: update wording on speed
The way I interpreted it, it seemed like this was not default behavior
and could be enabled with --audio-pitch-correction - it should be made
clearer that this is actually *the default behavior*.
2015-02-27 06:21:42 +01:00
Niklas Haas 0da6a7346a
vo_opengl: implement antiringing for tensor scalers
This is based on pretty much the same (somewhat naive) logic right now.
I'm not convinced that the extra logic that eg. madVR includes is worth
enough to warrant heavily confusing the logic for it.

This shouldn't slow down the logic at all in any sane shader compiler,
and indeed it doesn't on any shader compiler that I tested.

Note that this currently doesn't affect cscale at all, due to the weird
implementation details of that.
2015-02-27 04:35:15 +01:00
wm4 6e73b4dac7 input: handle closed pipe correctly 2015-02-26 22:09:01 +01:00
wm4 f47beb1f07 input: if FD is not writable, just don't write to the FD
This is for the case if the FD is a uni-directional pipe.
2015-02-26 22:09:00 +01:00
wm4 7b02c79a23 input: allow passing FDs to --input-file 2015-02-26 22:09:00 +01:00
wm4 a22de99544 input: avoid creating world-writeable file with --input-unix-socket
This requires fchmod(), which is not necessarily available everywhere.
It also might not work at all. (It does work on Linux.)
2015-02-26 21:44:35 +01:00
wm4 0035dbdbb8 audio: accept 1.0 and 2.0 as aliases for mono and stereo 2015-02-26 15:41:45 +01:00
wm4 a5f3083ae7 player: adjust A/V desync message
Broken drivers are an issue rather often. Maybe this gives the user an
idea that this could be the reason. (We can't dump much more info on a
80x24 terminal.)
2015-02-26 10:38:37 +01:00
wm4 280c826379 vo_opengl: test FBOs only if they're going to be used
Change test_fbo() so that it checks the FBO lazily, and restructure
check_gl_features() to invoke it only if we know that a FBO will be
needed for a certain enabled feature.

This can avoid strange error messages when using --vo=opengl and the
FBO format does not work. It's also less confusing when reading the
verbose log (users might think that the FBO is actually used, etc.).
2015-02-26 10:37:31 +01:00
wm4 a2e0cd7f25 vo_xv: don't attempt to clear window before mapped
This can happen with the "no-colorkey" suboption. Then the code in
xv_draw_colorkey() can be run before vo_x11_config_vo_window(), when
vo_gc is not allocated yet.

Fixes #1629.
2015-02-26 09:26:28 +01:00
Thiago Kenji Okada 633147c959 ytdl: add "--ytdl-params" option
This option allows the user to pass non-supported options directly to
youtube-dl, such as "--proxy URL", "--username USERNAME" and
'--password PASSWORD".

There is no sanity checking so it's possible to break things (i.e.
if you pass "--version" mpv exits with random JSON error).

Signed-off-by: wm4 <wm4@nowhere>
2015-02-25 22:32:48 +01:00
wm4 e85bcc1223 cache: use MPCLAMP() macro 2015-02-25 22:23:31 +01:00
wm4 899f0cd51e cache: limit to file size
Saves some memory. Should be especially helpful if many small files are
loaded, like when mass-loading subtitle files and the cache is enabled.
2015-02-25 22:23:25 +01:00
Stefano Pigozzi f3eb6ae783 remove dead comment 2015-02-25 22:17:22 +01:00
Stefano Pigozzi 8e80b3fd2f build: move QuartzCore linking to the cocoa check
It's needed for the DisplayLink functions so it must be enabled for the basic
cocoa code.
2015-02-25 22:13:07 +01:00
wm4 eb0db4d6fd sd_ass: replace a deprecated libass API call 2015-02-25 16:48:01 +01:00
wm4 9349cfca91 demux_mkv_timeline: fix potential issue when enabling cache
If the cache is enabled, the demuxer is closed and opened again (because
currently, the cache can not be enabled atfer data was already read).
The call for opening a new demuxer uses the same params struct, which
references the ctx->uids array. But there is a MP_TARRAY_GROW()
invocation somewhere on the way, which can reallocate the ctx->uids
array, making params.uids a dangling pointer.

This issue probably existed for a longer time, probably since 5cd33853
(slightly more obvious since f50b105d).
2015-02-25 13:31:37 +01:00
wm4 02bd54c0ac demux_mkv_timeline: move uids array to context too
Again removes some indirections and extra arguments.

Also replace some memcpy/memmoves with assignments. (Assignments became
possible only later, when reference UIDs were turned into a struct.)
2015-02-25 13:26:43 +01:00
wm4 2bf0a5f2bc demux_mkv_timeline: pass sources array as part of context
Removes tripple pointer indirections and such.
2015-02-25 13:26:32 +01:00