1
mirror of https://github.com/mpv-player/mpv synced 2024-07-31 16:29:58 +02:00
Commit Graph

42739 Commits

Author SHA1 Message Date
wm4
b0c1455aa4 img_format: add a generic flag for semi-planar formats 2016-01-07 16:30:34 +01:00
wm4
e2d90b383b img_format: take care of pixfmts that declare padding
A format could declare that some or all LSBs in a component are padding
bits by setting a non-0 AVComponentDescriptor.shift value. This means we
would interpret it incorrectly, because until now we always assumed all
regular formats have the padding in the MSBs.

Not a single format that does this actually exists, though. But a NV12
variant will be added later in FFmpeg.
2016-01-07 16:30:34 +01:00
James Ross-Gowan
c19f634e6c win32: fix fd://
Windows definitely supports Unix-style fd inheritance. This mostly
worked when launched from mpv.exe, though mpv should change the file
mode to O_BINARY. When launched from mpv.com, the wrapper must pass the
list of handles (stored in the undocumented lpReserved2 and cbReserved2
fields) to the mpv process.
2016-01-07 23:37:06 +11:00
Niklas Haas
82e81421d7 filter_kernels: improve the gaussian function
Commit 3909e4cd ended up losing the ability to tune the gaussian window,
which this commit trivially reintroduces.

The constant scaling factor (present in the code copied from glumpy)
also goes against filter_kernels.c conventions, which is that f(0.0) = 1
(and the invoking code takes care of normalization), and has been
removed.

The values of this new gaussian function corresponds to different
functions when compared against the old version. To translate the old
values p1 to the new values p2 requires solving 2^(e/p1) = e^(2/p2) or
p2 = p1 * 2/(e * ln(2)) ≈ p1 * 1.0615

In other words, to get the old default in the new function requires
setting scale-param1 to 1.0615. (The new function is *slightly* sharper
by default)

(Though most users should probably not notice the change)
2016-01-07 12:17:34 +01:00
wm4
0d05038790 filter_kernels: relicense under BSD
To get a uniform license for this file, relicense the mpv parts to BSD
as well.

But leave the door open for a later change to LGPL. (All non-Glumpy code
was written within mpv, and all mpv authors have agreed to LGPL
relicensing.)

Closes #2688.
2016-01-07 11:27:18 +01:00
wm4
38636345b1 vo_opengl: hwdec_vdpau: relicense under LGPL
All code was written by myself.
2016-01-07 11:22:54 +01:00
wm4
9604c45e24 vo_opengl: video.h: fix license
This is a mistake coming from commit 6ef06aa1: it accidentally changed
the license from GPL/LGPL dual to GPL only.
2016-01-07 10:48:04 +01:00
wm4
e69d1f2780 vo_opengl: hwdec_vaegl: change license to LGPL 2.1
This file claims to be based on the "MPlayer VA-API patch", but this is
untrue. Only some glue code was copied from hwdec_vaglx.c, and this glue
code was never in MPlayer or the MPlayer VA-API patch in any form, and
instead part of the mpv-original way we do hardware decoding OpenGL
interop. The EGL interop method didn't exist at the time the MPlayer
VA-API patch was created either.
2016-01-07 10:46:15 +01:00
wm4
e9af0592d9 mpv.desktop: add audio/mp4 mime type
Who thought mime types were a good idea?
2016-01-07 09:32:11 +01:00
wm4
ce60c1adf7 player: reset playback abort when reloading a file
PT_RELOAD_FILE is a somewhat obscure case when using DVB or when
switching Matroska editions. Both cases were broken, because the
asynchronous playback abort mechanism was still triggered. This
mechanism is used to force the demuxer and stream layers to exit
immediately (instead of blocking on I/O possibly forever), and
is normally disabled on playback start. The reopen path is a bit
strange, and needs to reset it manually.

Pointed out in #2568.
2016-01-07 09:11:15 +01:00
wm4
35f43dfacb player: make watch later/resume work when "playing" directories
If you do "mpv /bla/", and then branch out into sub-directories using
playlist navigation, and then used quit and watch later, then playing
the same directory did not resume from the previous point. This was
because resuming is based on the path hash, so a path prefix can't be
detected when resuming the parent directory.

Solve this by writing each path prefix when playing directories is
involved. (This includes all parent paths, so interestingly, "mpv /"
would also resume in the above example.)

Something like this was requested multiple times, and I want it too.
2016-01-06 22:40:55 +01:00
wm4
b7e179f6d3 video: fix debug message
Should not be a warning, and the message text was also very useless.
2016-01-06 19:48:55 +01:00
wm4
3909e4cdfc filter_kernels: replace AGG-based code
This commit replaces code based on AGG, taken from this source file:

http://vector-agg.cvs.sourceforge.net/viewvc/vector-agg/agg-2.5/include/agg_image_filters.h

The intention is that filter_kernels.c can be relicensed to LGPL or BSD.
Because the AGG author died, full replacement is the only way to achieve
it.

This affects only some filter functions. These are exclusively
mathematical functions for computing filter coefficients. (Other parts
in filter_kernel.c were originally written by me, with heavy additions
and refactoring done by other mpv contributors.) While the code is
mostly just well-known mathematical formulas written down in C form,
AGG copyright could perhaps be claimed anyway.

To remove the AGG code, I replaced it with the filter functions from:

https://github.com/glumpy/glumpy/blob/master/glumpy/library/build-spatial-filters.py

These functions conveniently compute exactly the same thing in mpv,
Glumpy, AGG (and about anything that will filter images using the same
mathematical principles).

First I ported the Python code in the file to C. Then I replaced all
functions in filter_kernels.c with this code that could be replaced.
Then I investigated whether the remaining functions were based on AGG
code and took appropriate action:

hanning(), hamming(), quadric(), bicubic(), kaiser(), blackman(),
spline16(), spline36(), gaussian(), sinc() were taken straight from
Glumpy.

For sinc(), re-add the "fabs(x) < 1e-8" check, which was added in commit
586dc557 for unknown reasons.

gaussian() loses its filter parameter for some reason. (Well, who cares,
not my problem.)

The really awkward thing is that the text for hanning() and hamming()
does not change. In theory these functions are now based on Glumpy code,
but it seems like this can be neither proven nor denied. (The same
happened in some other cases with at least a few lines of code.)

sphinx() was added in commit 586dc557, and looks suspiciously like
sinc() as well. Replace the first 3 lines of the body with the ported
function (of which 2 lines do not change; the first uses code only in
mpv, and the second is just "return 1.0;"). The 4th line is only similar
on an abstract level (and that because of the mathematical relation
between these functions). Although the original sinc() was probably used
as template for it, with the other lines replaced, I don't think you
could make the claim that it falls under AGG copyright.

jinc() was added in commit 26baf5b9, but the code for it might be based
on sinc(). Rewrite it based on the "new" sinc(). Some of the same
remarks as with sphinx() apply.

cubic_bc() was ported from Glumpy's Mitchell(). (As far as I'm aware,
with the default parameters it's called "the" Mitchell-Netravali filter,
but in mpv this function is used to generate a whole group of filters.)

spline64() was added in commit a8b67c66, and was probably derived from
spline36(). Re-derive it from the "new" spline36().

triangle() could be considered derived from the original bilinear().
This is this in the original commit:

    static double bilinear(kernel *k, double x)
    {
        return 1.0 - x;
    }

This _might_ be based on AGG's image_filter_bilinear:

    struct image_filter_bilinear
    {
        static double radius() { return 1.0; }
        static double calc_weight(double x)
        {
            return 1.0 - x;
        }
    };

Considering that the "framework" was written by me, and the only part
from AGG taken is "return 1.0 - x;", and this part is trivial and was
later thoroughly replaced, this is probably not under the AGG copyright.

I'm hoping this doesn't introduce regressions. But the main focus is not
being productive anyway, and I didn't rigorously check unintended
changes in functionality.
2016-01-06 18:46:56 +01:00
wm4
3e90a5fe81 ao_dsound: remove this audio output
It existed for XP-compatibility only. There was also a time where
ao_wasapi caused issues, but we're relatively confident that ao_wasapi
works better or at least as good as ao_dsound on Windows Vista and
later.
2016-01-06 13:52:15 +01:00
Kevin Mitchell
27ccad541a ao_wasapi: remove unnecessary header file
All the wasapi files were including both ao_wasapi.h and ao_wasapi_utils.h.
Just merge them into a single file.
2016-01-05 17:47:55 -08:00
Kevin Mitchell
bf611ff0f6 ao_wasapi: initialize change notify in main thread
This is something else that has nothing to do with audio rendering.
2016-01-05 17:47:55 -08:00
Kevin Mitchell
0c877d2fdc ao_wasapi: remove old vistablob prototype
this function was removed earlier, but the prototype was missed
2016-01-05 17:47:55 -08:00
Kevin Mitchell
8368ead1fa ao_wasapi: make find_deviceID read only wrt struct ao
This makes it clearer that state->device is being allocated.
2016-01-05 17:47:55 -08:00
Kevin Mitchell
d22d24a6d5 ao_wasapi: move device selection to main thread
In attempt to simplify the audio event thread, this can now be moved out.
2016-01-05 17:47:55 -08:00
Kevin Mitchell
fb84c6974d ao_wasapi: avoid some redundant error messages in device selection
If these error conditions are triggered, the called function will have already
output a sufficiently informantive error message.
2016-01-05 17:47:55 -08:00
Kevin Mitchell
92ded6c6fd ao_wasapi: alloc later to avoid free on error
In get_device_desc, don't alloc the return value until we know there
wasn't an error.
2016-01-05 17:47:55 -08:00
wm4
3d03298e86 audio: update outdated comment 2016-01-05 22:08:51 +01:00
wm4
c1002f6a28 ao_pulse: attempt to fall back to an arbitrary sample format
Normally, PulseAudio accepts any combination of sample format, sample
rate, channel count/map. Sometimes it does not. For example, the channel
rate or channel count have fixed maximum values. We should not fail
fatally in such cases, but attempt to fall back to a working format.

We could just send pass an "unset" format to Pulse, but this is not too
attractive. Pulse could use a format which we do not support, and also
doing so much for an obscure corner case is not reasonable. So just pick
a format that is very likely supported.

This still could fail at runtime (the stream could fail instead of going
to the ready state), but this sounds also too complicated. In
particular, it doesn't look like pulse will tell us the cause of the
stream failure. (Or maybe it does - but I didn't find anything.)

Last but not least, our fallback could be less dumb, and e.g. try to fix
only one of samplerate or channel count first to reduce the loss, but
this is also not particularly worthy the effort.

Fixes #2654.
2016-01-05 19:52:05 +01:00
wm4
861c126b08 ao_pulse: check for sample rate bounds
pa_format_info_valid() does not do this. (Although there is a proposed
patch on the PulseAudio mailing list.)

See #2654.
2016-01-05 19:37:08 +01:00
wm4
8fda7247ff ao_pulse: move format setting into a function
No real functional changes.
2016-01-05 19:34:34 +01:00
wm4
172ce98433 options: raise maximum value for --audio-samplerate
Helps with testing.
2016-01-05 19:15:21 +01:00
wm4
481d15ae60 vo_rpi: handle rotation
Since the MMAL video renderer component supports exactly what we need,
it's pretty simple.
2016-01-05 14:48:27 +01:00
wm4
0b5af5639b vo_rpi: work around firmware oddness leading to incorrect video rect
Apparently, the firmware will ignore pixel_x/pixel_y if the numeric
value of them gets too high (even if they indicate square pixel aspect
ratio). Even worse, the destination rectangle is ignored completely,
and the video frame is simply stretched to the screen. I suspect this
is an overflow or weird sanity check within the firmware.

Work it around by limiting the fields to 16000, which is an arbitrary
but apparently working limit.
2016-01-05 14:20:47 +01:00
Stefano Pigozzi
0015afd059 bundle: remove git sha from the Info.plist version
Fixes #2677
2016-01-05 12:27:04 +01:00
Chris Mayo
d0cd7fa31b build: add option of html manual 2016-01-05 11:24:08 +01:00
fwr
a655432bbe demux_lavf: re-enable codepage autodetection for .ass
There are a lot of incorrectly encoded subtitles with .ass extension
and non-ass subtitles (srt, ssa) with such extension, so we need to
try codepage detection even for .ass.

Signed-off-by: wm4 <wm4@nowhere>
2016-01-04 19:19:00 +01:00
wm4
09f0f68959 ao_wasapi: remove +x flag from files 2016-01-04 19:18:02 +01:00
wm4
dac5b598f5 chmap_sel: prefer inexact equivalents over perfect upmix
Given 5.1(side), this lets it pick 5.1 from [5.1, 7.1]. Which was
probably the original intention of this replacement stuff. Until now,
the opposite was done in some cases.

Keep the old heuristic if the replacement is not perfect. This would
mean that a subset of the channel layout is an inexact equivalent, but
not all of it.

(My conclusion is that audio output APIs should be designed to simply
take any channel layout, like the PulseAudio API does.)
2016-01-04 19:17:56 +01:00
Kevin Mitchell
cb8b0cc329 ao_wasapi: just use a pointer to the deviceID in change_notify
Rather than creating a new string from the device instance. This will allow
moving the change_init to the main thread before the device is loaded.
2016-01-04 07:41:21 -08:00
Kevin Mitchell
029e31f1c5 ao_wasapi: correctly name the IMMNotificationClientVtbl 2016-01-04 07:41:21 -08:00
Kevin Mitchell
efb9943637 ao_wasapi: make persistent enumerator local to change_notify
This is no longer required by anything else
2016-01-04 07:41:21 -08:00
Kevin Mitchell
243a2976a8 ao_wasapi: rewrite device listing and selection
Unify and clean up listing and selection. Use common enumerator code for both
operations to avoid duplication or inconsistencies.

Maintain, but significatnly simplify manual device selection by id, name or
number. This actually fixes loading by name which didn't really work before
since the "name" displayed by --audio-device=help differed from that used to
match the selection, which used the device "description" instead.

Save the selected deviceID in the private structure for later loading. This will
permit moving the device selection into the main thread in a future commit.
2016-01-04 07:41:21 -08:00
wm4
c725f39bae vo_opengl: fix operation on GLES 2.0
GLSL in GLES 2.0 did not have line continuation in its preprocessor.
This broke shader compilation. It also broke subtitle rendering in
vo_rpi, which reuses some of the OpenGL code.

Line continuation was finally added in GLES 3.0, which is perhaps the
reason why ANGLE accepted it.
2016-01-04 16:34:16 +01:00
wm4
1f38c2107d sd_ass: fix memory leaks with --sub-ass=no
This affects only the codepath which forcibly disables any ASS tags.
2016-01-04 15:29:29 +01:00
Bin Jin
2f4bd58f4a vo_opengl: reset nnedi3 weights properly
Fixes #2661
2016-01-03 23:33:54 +01:00
wm4
fa315705be x11: silence xdg-screensaver failure message 2016-01-03 15:50:00 +01:00
wm4
2c3f4850b8 player: make sure streams are selected with ordered chapters
When using --start with timeline/ordered chapters, then the
timeline_switch_to_time() function will look at playback_initialized
whether to rselect the currently selected streams on the demuxer level.
So we need to set this field to true at an earlier stage during
initialization, and in particular before the code for --start is called.
2016-01-03 15:48:47 +01:00
wm4
13ade4f1bc CONTRIBUTING: discourage reports against unmaintained releases
Seriously, why do users do this?
2016-01-03 15:42:02 +01:00
Kevin Mitchell
9163bdc38a ao_wasapi: fix delay calculation again
Apparently it's only wine where the qpc_position returned by
IAudioClock_GetPosition can be overflowed. So actually do the rescaling
correctly, but throw away the result if it looks unreasonable.

this fixes a regression in 5afa68835a
2016-01-02 08:10:52 -08:00
wm4
d5f29a3c36 options: exclude 360 from --video-rotate range
It's indeed completely useless. Pointed out in #2647.
2016-01-02 14:31:46 +01:00
wm4
de0523ba7b Update copyright year
Merry christmas, or whatever the fuck is going on right now.
2016-01-01 00:18:40 +01:00
wm4
ad072b17ce sub: do not check for duplicates if --sub-clear-on-seek is set 2015-12-31 16:43:57 +01:00
wm4
2059ba2c40 video: do not disable hr-seek framedrop too early
This didn't make too much sense, and just made seeking slower. Strictly
suggest the decoder to drop a frame if its PTS is before the seek
target.
2015-12-30 15:51:47 +01:00
Kagami Hiiragi
492e3deb95 demux_mkv: skip EBML void elements
EBML_ID_VOID might occur at any level, see:
https://github.com/Matroska-Org/ebml-specification/blob/master/specification.markdown
This change prevents "Corrupt file detected" errors on completely valid
files.
2015-12-29 20:39:34 +01:00
Eric G
fb185e4e79 TOOLS/zsh.pl: add .opus extension in zsh completions 2015-12-29 19:30:57 +01:00