Commit Graph

38095 Commits

Author SHA1 Message Date
Kevin Mitchell 2b1b8d6c95 vf_dlopen: update usage message to new-style args 2014-05-15 10:32:16 -07:00
Kevin Mitchell 125dcf306a vf_dlopen: remove buggy private name -> imgfmt conversion
This was presumably for backward compatibility,
but it was preventing the use of the new names.
2014-05-15 10:32:16 -07:00
wm4 0128579542 vf_vapoursynth: fix debug output 2014-05-15 16:59:26 +02:00
wm4 97604ebcd2 vf_vapoursynth: add more debug output
Also, move num_requested() to where it's used. Remove newlines from VS
error messages. Remove an assert(0) on an error path.
2014-05-15 14:50:35 +02:00
wm4 a5e22c70e8 manpage: changes.rst: minor fixups 2014-05-15 14:49:19 +02:00
wm4 daf4898668 vf_vapoursynth: avoid unnecessary waiting
It could in theory happen that the filter loop will enter a blocking
wait, even though it could make progress by emptying the list of
already-filtered images. I'm not quite sure if this could actually cause
a real issue - probably not.
2014-05-14 21:02:56 +02:00
wm4 6dec78e475 TOOLS/mpv_identify.sh: unbreak 2014-05-14 20:56:09 +02:00
wm4 bc6959c35d vf_vapoursynth: allow parallel processing
VapourSynth won't just filter multiple frames at once on its own. You
have to request multiple frames at once manually. This is what this
commit introduces: a sub-option controls how many frames will be
requested at once. This also changes the semantics of the maxbuffer sub-
option, now renamed to buffered-frames.
2014-05-14 20:42:04 +02:00
wm4 d6774515a7 manpage: updates changes.rst
The situation has changed a bit since the days of mplayer2, so we can
use more/less diplomatic wording. Merge the two sections listing
changes from MPlayer and mplayer2. Mention the client API and Lua
scripting as alternatives to slave mode.

I'm calling MPlayer code "horrible". This is not meant as an offense,
but after turning around almost every line of MPlayer code, I believe
I have a right to say this. Sorry. I would say that MPlayer has a
surprisingly sane and simple architecture (for what it is), but much
of it drowned under a load of evil hacks or not-cleaned-up-yet code.
2014-05-14 20:42:04 +02:00
wm4 d0a66dbd5d old-build: accidental rewrite
This started as a bunch of smaller changes to make the old configure
script maintainable with minimum effort. It ended up as complete
rewrite, because at once point I started to like shell programming (I
hope this sickness is curable), and I wanted to see how small I can
make the configure script. The typical configure test is now 1 or 2
lines big, located in 1 or 2 places, instead of >15 lines and being
spread over 5 or 6 places.

The main "trick" is factoring the tests into a few generic, commonly
needed tests, instead of writing everything manually.
2014-05-14 20:42:04 +02:00
wm4 eb4487cc4f old-build: drop support for anything but Linux, simplify
A lot of effort was spent on making the waf based build-system work
properly on all supported platforms, while the old configure script was
neglected. It seems that nobody maintains the non-Linux parts of the
configure script anymore, and all improvements go into the waf scripts.

Thus it makes no sense anymore to maintain the non-Linux parts. They're
just dead weight. Remove them completely.

Also apply some additional simplifications. For example, listing
enabled/disabled VO modules seems like a waste of effort.
2014-05-14 20:42:04 +02:00
wm4 fe4526195a build: add some warning cflags
These were in the old configure script too.

Two flags are explicitly tested, because I have no idea how widespread
support for them is, and testing them is just easier than trying to look
them up in various gcc/clang manuals. There are people using gcc 4.2
out there, so some caution is warranted.
2014-05-14 20:42:04 +02:00
Alexander Preisinger adf20c9775 wayland: fix typo
So long in the code without me noticing. Embarassing!
2014-05-14 20:29:08 +02:00
wm4 2279f718de player: reorganize how lua scripts are loaded
Make loading of scripts independent of Lua. Move some of the loading
code from lua.c to scripting.c, and make it easier to add new scripting
backends.
2014-05-13 02:39:37 +02:00
wm4 2a2dd8aac2 old-build: define a new symbol
waf has a proper test, but no test was added to old-configure.

This means that on OSX, old-configure is not supposed to work anymore.
But still allow it to compile cleanly on OSX.
2014-05-13 01:09:53 +02:00
Kevin Mitchell a6762dbc16 stream_smb: increase to 128k read_chuuk from default 8k
Previous to this commit, read_chunk was not set in stream_smb. The
cache was therefore filled in small 8K chunks. This resulted in poor
performance when compared to, for example, smbnetfs on the same
network.

The value of 128k is chosen both because it is emperically
the "levelling off point" for throughput into mpv's cache, and because
it is the value chosen by smbnetfs when serving smb shares to
mpv.

Note that this change has no effect unless --cache is explicitly
specified as smb:// streams do not activate cache by default. This is
because the default cache size of 320K is so small it actually makes
smb:// perfomance worse. For best results use at least --cache=1024.
2014-05-12 15:09:38 -07:00
wm4 9e94de29b7 player: disable hr-seek framedropping during backstepping 2014-05-12 23:24:19 +02:00
wm4 176b4abd53 build: fix OpenBSD DVD/CDROM device names
Closes #781.
2014-05-12 23:24:19 +02:00
Luca Barbato e0e79a2e7e vda: Hwaccel 1.2 support
Use the new context and the default functions provided.
2014-05-12 12:59:16 +02:00
Luca Barbato dab56b5fd5 vda: Simplify codec selection
VDA supports h264 only.
2014-05-12 12:59:16 +02:00
Luca Barbato 5cbfdac2a8 vd_lavc: Support hwaccel 1.2 and later
Hwaccel 1.2 populates only the third data field and assumes
that the AVCodecContext is available to the dealloc function.
2014-05-12 12:59:16 +02:00
wm4 c78b8b2c0c audio/out: fix previous commit
This didn't quite work. The main issue was that get_space tries to be
clever to reduce overall buffering, so it will cause the playloop to
decode and queue only as much audio as is needed to refill the AO in
reasonable time. Also, even if ignoring the problem, the logic of the
previous commit was slightly broken. (This required a few retries,
because I couldn't reproduce the issue on my own machine.)
2014-05-11 20:51:49 +02:00
wm4 665c8b59be audio/out: avoid wakeup feedback loop
When the audio buffer went low, but could not be refilled yet, it could
happen that the AO playback thread and the decode thread could enter a
wakeup feedback loop, causing up to 100% CPU usage doing nothing. This
happened because the decoder thread would wake up the AO thread when
writing 0 bytes of newly decoded data, and the AO thread in reaction
wakes up the decoder thread after writing 0 bytes to the AO buffer.

Fix this by waking up the decoder thread only if data was actually
played or queued. (This will still cause some redundant wakeups, but
will eventually settle down, reducing CPU usage close to ideal.)
2014-05-11 19:00:05 +02:00
wm4 fd56e2dbe6 TOOLS/stats-conv: don't crash on empty lines 2014-05-11 18:16:33 +02:00
wm4 cc94436c5b TOOLS/stats-conv: draw playloop and AO thread events separately
Use for all AO thread events y=0.5, while playloop events remain at y=1.
This makes the graph easier to read.
2014-05-11 17:07:26 +02:00
wm4 7cab9ea2fa manpage: update --playlist entry 2014-05-11 16:51:33 +02:00
wm4 77ce54c698 mixer: make code more readable
You wouldn't have guessed that the bottom-most "level[i] = 0.f;" line
was actually required. It even confused cppcheck.
2014-05-11 16:41:19 +02:00
wm4 09ecf7a68a audio/out: more debugging info for --dump-stats 2014-05-11 16:41:19 +02:00
wm4 342298fd1a wayland: fix unchecked malloc usage
Found by cppcheck.

Actually untested. (This is the file drag&drop code, I don't even know
which wayland clients support this.)
2014-05-11 16:41:17 +02:00
wm4 3d530af8ef player: don't assign "false" to pointer
This is legal in theory. "false" expand to 0, and 0 is a valid pointer
value. But I guess this was not really intended.

Found by cppcheck.
2014-05-11 16:41:09 +02:00
wm4 0d916c7f96 build: removed undefined behavior from PVR check
This shouldn't matter, but it's probably better if the code to check is
valid - otherwise an extremely clever compiler might fail to compile it,
and the feature would be misdetected. (Probably.)

Found by cppcheck.
2014-05-11 16:41:02 +02:00
wm4 194e221181 demux_playlist: fix m3u detection logic
Caused failure to detect .pls files, because they were misdetected as
m3u. The problem is that "forcing playlist files" and "forcing a
specific playlist format" are not really treated separate, and in both
cases p->force is set to true. This made m3u detect all files as m3u
if --playlist was used. So correctly check whether the file format is
actually being probed or not.
2014-05-11 16:40:41 +02:00
wm4 f5be96a6e5 manpage: minor corrections 2014-05-11 15:42:12 +02:00
wm4 31663beeac input: remove pausing command prefixes
These are now equivalent to combining commands with the "cycle pause" or
"set pause" commands, and thus are not needed anymore. They were also
obscure and undocumented.
2014-05-11 15:41:34 +02:00
wm4 4b367d1602 player: don't complain on too long filenames
mpv supports per-file config files, basically filename+".conf". We use
a static buffer for the new filename, and if that buffer is too small,
we print a warning. This is confusing for e.g. long URLs, so just hide
the warning by default.

Why not dynamically allocate the buffer? Who cares.
2014-05-10 16:08:07 +02:00
wm4 6f86e32630 old-makefile: add a missing source directory
Fixes "make clean".
2014-05-10 15:46:12 +02:00
Stefano Pigozzi b4e598badf ao_coreaudio: skip unknown channel labels
I don't think this is really a very good idea because it is conceptually
incorrect but other prominent multimedia programs use this approach
(VLC and xbmc), and it seems to make the conversion more robust in certain
cases.

For example it has been reported, that configuring a receiver that can output
7.1 to output 5.1, will make CoreAudio report 8 channel descriptions, and the
last 2 descriptions will be tagged kAudioChannelLabel_Unknown.

Fixes #737
2014-05-10 14:07:45 +02:00
Stefano Pigozzi 1a4f4f80bf ao_coreaudio: remove useless code
This code doesn't actually makes much of a difference, and the AudioUnit
mostly wants layout tags anyway.
2014-05-10 14:07:45 +02:00
Stefano Pigozzi 2a0a13425f ao_coreaudio: don't fallback to full waveext
The code was falling back to the full waveext chmap_sel when less than 2
channels were detected. This new code is slightly more correct since it only
fills the chmap_sel with the stereo or mono chmap in the fallback case.
2014-05-10 14:07:45 +02:00
Stefano Pigozzi 39b316ff06 ao_coreaudio: cosmetic change of loop ending condition 2014-05-10 14:07:45 +02:00
Stefano Pigozzi eb9d7d5c78 ao_coreaudio: print an error when channel mapping fails 2014-05-10 14:07:45 +02:00
Stefano Pigozzi b46ffaec7c ao_coreaudio: use description-based channel layouts
CoreAudio supports 3 kinds of layouts: bitmap based, tag based, and speaker
description based (using either channel labels or positional data).

Previously we tried to convert everything to bitmap based channel layouts,
but it turns out description based ones are the most generic and there are
built-in CoreAudio APIs to perform the conversion in this direction.

Moreover description based layouts support waveext extensions (like SDL and
SDR), and are easier to map to mp_chmaps.
2014-05-10 14:07:45 +02:00
Stefano Pigozzi e2f26f01fe ao_coreaudio: pass layout by reference to logging function
Apparently passing the struct by value somehow messed with the value of some
fields.
2014-05-10 14:07:45 +02:00
Stefano Pigozzi e7d1c12131 chmap_sel: add channel replacement for sl/sr <-> sdl/sdr
This can be use useful for the 7.1 rear layout. In particular it looks like
OS X likes to use sdl/sdr as opposed to sl/sr.
2014-05-10 14:07:45 +02:00
wm4 26b00ffe8a x11: fix potentially unaligned access in icon loader
Tried to load a 32 bit value by dereferencing a uint32_t pointer, but
the pointer is not guaranteed to be aligned, not even in practice.
2014-05-10 10:44:16 +02:00
wm4 3075ea01db sub: fix undefined behavior in ASS color calculation (2)
Same problem as previous commit, fix by using the MP_ASS_RGBA() macro.
2014-05-10 10:44:16 +02:00
wm4 485d033b5f sub: fix undefined behavior in ASS color calculation
This might shift bits into the sign, which is undefined behavior. Making
the right operand unsigned was supposed to help with this, but it seems
it did nothing, and C99 makes the result type dependent on the left
operand only.
2014-05-10 10:44:16 +02:00
wm4 3c322b1022 common: change MP_NOPTS_VALUE definition
Use the exact floating point value, instead of a broken integer
constant. The expression calculating the constant probably relied on
undefined behavior, because it left-shifts a negative value.

This also changes the type of the constant to double, which is perfectly
fine, and maybe better than an integer constant.
2014-05-10 10:44:16 +02:00
wm4 fc385baf02 encode: fix PTS unit mismatch
This used MP_NOPTS_VALUE to compare with ffmpeg-style int64_t PTS
values. This probably happened to work, because both constants use the
same value.
2014-05-10 10:44:16 +02:00
wm4 bc9a86c392 vdpau: make mp_vdpau_ctx thread-safe
Preparation so that various things related to video can run in different
threads. One part to this is making the video surface pool safe.

Another issue is the preemption mechanism, which continues to give us
endless pain. In theory, it's probably impossible to handle preemption
100% correctly and race-condition free, unless _every_ API user in the
same process uses a central, shared mutex to protect every vdpau API
call. Otherwise, it could happen that one thread recovering from
preemption allocates a vdpau object, and then another thread (which
hasn't recovered yet) happens to free the object for some reason. This
is because objects are referenced by integer IDs, and vdpau will reuse
IDs invalidated by preemption after preemption.

Since this is unreasonable, we're as lazy as possible when it comes to
handling preemption. We don't do any locking around the mp_vdpau_ctx
fields that are normally immutable, and only can change when recovering
from preemption. In practice, this will work, because it doesn't matter
whether not-yet-recovered components use the old or new vdpau function
pointers or device ID. Code calls mp_vdpau_handle_preemption() anyway to
check for the preemption event and possibly to recover, and that
function acquires the lock protecting the preemption state.

Another possible source of potential grandiose fuckup is the fact that
the vdpau library is in fact only a tiny wrapper, and the real driver
lives in a shared object dlopen()ed by the wrapper. The wrapper also
calls dlclose() on the loaded shared object in some situations. One
possible danger is that failing to recreate a vdpau device could trigger
a dlclose() call, and that glibc might unload it. Currently, glibc
implements full unloading of shared objects on the last dlclose() call,
and if that happens, calls to function pointers pointing into the shared
object would obviously crash. Fortunately, it seems the existing vdpau
wrapper won't trigger this case and never unloads the driver once it's
successfully loaded.

To make it short, vdpau preemption opens up endless depths of WTFs.

Another issue is that any participating thread might do the preemption
recovery (whichever comes first). This is easier to implement. The
implication is that we need threadsafe xlib. We just hope and pray that
this will actually work. This also means that once vdpau code is
actually involved in a multithreaded scenario, we have to add
XInitThreads() to the X11 code.
2014-05-10 10:44:16 +02:00