| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This seems safer: otherwise, opening the AO could randomly fail if the
audio formats happens to be not float.
Unfortunately, this only works if the user does not select a device.
Since ALSA devices are arbitrary strings, including plugins with complex
parameters, it's not trivial or maybe even impossible to edit the string
in a way the "plug" plugin is added.
With --audio-device, it would be safe for users to select either
"default" or one of the "plughw" devices. Everything else seems
questionable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the ALSA channel map API for querying and selecting supported
channel maps.
Since we (probably?) want to be compatible with ALSA versions before the
change, we still try to select the device name by channel map, and open
that device. There's no way to negotiate a channel map before opening,
so we're stuck with this approach. Fortunately, it seems these devices
allow selecting and setting any other supported channel layout, so maybe
this is not an issue at all. In particular, this avoids selecting the
default (dmix) device, which can only do stereo.
Most code is based on Martin Herkt <lachs0r@srsfckn.biz>'s alsa_ng
branch, with heavy modifications.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't crash if no fallback channel layout could be found (caller can't
handle NULL return from select_chmap()). Apparently this could never
actually happen, though.
Don't treat snd_pcm_hw_params_set_periods_near() failure as fatal error.
Same deal as with snd_pcm_hw_params_set_buffer_time_near().
Actually free channel maps returned by snd_pcm_get_chmap().
Adjust some messages.
|
|
|
|
|
|
|
| |
Currently, --ytdl is off by default, but even if this is changed, never
enable it by default for the client API. It would be inappropriate to
start an intrusive external subprocess behind the host application's
back.
|
| |
|
|
|
|
| |
Simpler overall.
|
|
|
|
|
|
|
|
|
| |
No functional changes.
ALSA_PCM_NEW_HW_PARAMS_API was a pre-ALSA 1.0.0 thing and does nothing
with modern ALSA. It stopped being necessary about 10 years ago.
3 functions are moved to avoid forward references.
|
|
|
|
|
|
|
| |
Makeshift-solution for working around certain fontconfig issues.
With --use-text-osd=no, libass and fontconfig won't be initialized, and
fontconfig won't block everything with scanning for fonts.
|
|
|
|
| |
Simplifies memory management.
|
|
|
|
|
|
|
|
| |
If ALSA reports a channel map, and it looks like it makes sense (i.e.
could be converted to mpv channel map, and the channel count matches),
then use that instead of the channel map we are assuming.
This is based on code written by lachs0r (alsa_ng branch).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't actually want to test all possible combinations; we just want
to make sure that each thing (e.g. linux/osx, ffmpeg/libav) is tested
once.
Exclude Linux + ffmpeg-stable, because ffmpeg-stable is already tested
on OSX.
Exclude clang on Linux, because OSX needs clang, but Coverity (running
on Linux) needs gcc - so we use gcc only on Linux.
I also wanted to reduce the matrix to a single configuration when
running Coverity, but apparently this is not possible.
(See travis-ci/travis-ci#1975.)
|
|
|
|
|
|
|
|
| |
For the purpose of running Coverity correctly.
Although I'm not sure how well this works. gcc won't work on OSX, and
also I'm not sure if Coverity will act up if the build matrix has more
than 1 configuration (will it submit multiple scans?).
|
| |
|
| |
|
|
|
|
|
|
| |
Simpler, and leaves the decision to repeat or not fully to the script
(instead of requiring the user to care about it when remapping a script
binding).
|
|
|
|
|
|
| |
MPV_EVENT_SCRIPT_INPUT_DISPATCH is now unused/deprecated.
Also remove a debug-print from defaults.lua.
|
|
|
|
|
| |
If repeated framestep commands are sent, just unpause the player, instead
of playing N frames for N repeated commands.
|
|
|
|
|
|
| |
Recent regression. It turns out the assertion was completely unneeded.
Fixes #1285.
|
|
|
|
|
| |
Much of it is the same, but now there's the possibility to distinguish
key down/up events in the Lua API.
|
|
|
|
|
|
| |
Use a fixed size array for the client name, which also limits the client
name in size. Sanitize the client name string, and replace characters
that are not in [A-Za-z0-9] with '_'.
|
|
|
|
| |
Broken by previous commit. Oops.
|
|
|
|
|
|
|
| |
But seriously, don't use --wid=0, don't use vo_xv, and _especially_
don't use vo_x11.
Fixes #1284.
|
|
|
|
|
|
|
|
|
|
| |
Otherwise, mouse button bindings added by mp.add_key_binding() would be
ignored.
It's possible that this "breaks" some older scripts using undocumented
Lua script functions, but it should be safe otherwise.
Fixes #1283.
|
|
|
|
|
| |
Don't recursively include the whole stream.h header; only include what's
minimally needed, and handle the rest with forward declarations.
|
|
|
|
|
| |
I spotted to the grammatically incorrect "it's", and ended up redoing
parts of the section.
|
|
|
|
|
|
| |
The subprocess code was already split into fairly general functions,
separate from the Lua code. It's getting pretty big though, especially
the Windows-specific parts, so move it into its own files.
|
| |
|
|
|
|
|
| |
Apparently both parameters refer to the same set of flags (the first is
a mask for which flags to set.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Normally, when creating a process with inherited handles on Windows, the
process inherits all inheritable handles from the parent, including ones
that were created on other threads. This can cause a race condition,
where unintended handles are copied into the new process, preventing
them from being closed correctly while the process is running. The only
way to prevent this on Windows XP was to serialise the creation of all
inheritable handles, which is clearly unacceptable for libmpv.
Windows Vista solves this problem by allowing programs to specify
exactly which handles are inherited, so do that on Vista and up.
See http://blogs.msdn.com/b/oldnewthing/archive/2011/12/16/10248328.aspx
|
|
|
|
|
|
|
|
|
|
|
|
| |
The CREATE_NO_WINDOW flag is used to prevent the subprocess from
creating an empty console window when mpv is not running in a console.
When mpv is running in a console, it causes the subprocess to detach
itself, and prevents it from seeing Ctrl+C events, so it hangs around in
the background after mpv is killed.
Fix this by only specifying CREATE_NO_WINDOW when mpv is not attached to
a console. When it is attached to a console, subprocesses will
automatically inherit the console and correctly receive Ctrl+C events.
|
|
|
|
|
|
|
| |
I'm not sure if this is necessary, but it can't hurt, and it's what
you're supposed to do before leaving the stack frame that contains the
OVERLAPPED object and the buffer. If there is no pending I/O, CancelIo
will do nothing and GetOverlappedResult will silently fail.
|
|
|
|
| |
Compatibility to older idet is preserved.
|
|
|
|
|
|
| |
This is some terrible code; I blame MPlayer legacy.
Found by Coverity.
|
|
|
|
|
|
| |
The wrong value was checked for an error. Oops.
Found by Coverity.
|
|
|
|
| |
Also shuts up Coverity.
|
|
|
|
|
|
|
| |
Independent from whether the samplerate was accepted or adjusted, errors
returned by the ioctl are fatal errors.
Found by Coverity.
|
|
|
|
|
|
| |
The caller set up the "start" pointer array using the number of planes,
the encode() function used the number of channels. This copied
uninitialized values for packed formats, which makes Coverity warn.
|
|
|
|
|
|
|
|
| |
From what I understand the division is to align the dimension of the
value from seconds to milliseconds. Hard to tell whether the "rounding"
was intentional or not; I'm tipping on "not".
Found by Coverity.
|
|
|
|
| |
None of this really matters.
|
|
|
|
| |
Found by Coverity; also see commit 85fb2af3.
|
|
|
|
| |
Because it looks nice.
|
|
|
|
|
|
|
| |
Silences a Coverity warning.
Also, drop the assert(); although it should be pretty much guaranteed
that things happen this way, it's still a bit fuzzy.
|
|
|
|
|
|
|
|
|
|
| |
In addition to the messed-up expression, the endianness was also
inverted. The code reads big endian by default.
It "worked" by coincidence, but for little endian, codepoints outside of
latin1 were broken.
The broken expression was found by Coverity.
|
|
|
|
|
|
| |
This is clearly not allowed, although it's not a problem on most libcs.
Found by Coverity.
|
|
|
|
|
|
|
|
| |
In all of these situations, NULL is logically not allowed, making the
checks redundant.
Coverity complained about accessing the pointers before checking them
for NULL later.
|
|
|
|
| |
Found by Coverity.
|
|
|
|
|
|
|
| |
Expressions involving uint16_t are promoted to int, which then can
overflow if the uint16_t values are large enough.
Found by Coverity.
|
|
|
|
|
|
|
| |
Could index static arrays from arbitrary input data without checking for
bounds.
Found by Coverity.
|
|
|
|
| |
Found by Coverity.
|
|
|
|
|
|
| |
Needs 1 additional free entry.
Found by Coverity.
|
|
|
|
| |
Found by Coverity.
|
|
|
|
| |
They said YAML is "simple"...
|
|
|
|
| |
I guess it didn't like the duplicate env section.
|
|
|
|
| |
It'll be useless.
|
|
|
|
|
| |
Not sure if this will work. Probably not, because it seems Coverity will
be missing some required dependencies.
|
|
|
|
| |
For these, autorepeat is enabled.
|
|
|
|
|
|
| |
The fact that it's a generic command prefix that is parsed even when
using the client API is a bit unclean (because this flag makes sense
for actual key-bindings only), but it's less code this way.
|
|
|
|
|
|
|
|
| |
Does the same thing as the drop_buffers command. When implementing that
command, it turned out that resetting the higher level playback state
was more effective for achieving smooth recovery.
Untested; I don't even have any DVDs or DVD images with multiple angles.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This command was actually requested on IRC ages ago, but I forgot about
it.
The main purpose is that the decoding state can be reset without issuing
a seek, in particular in situations where you can't seek.
This restarts decoding from the middle of the packet stream; since it
discards the packet buffer intentionally, and the decoder will typically
not output "incomplete" frames until it has recovered, it can skip a
large amount of data.
It doesn't clear the byte stream cache - I'm not sure if it should.
|
|
|
|
|
| |
From what I can see, only the blockduration of the packet needs to be
added, never the "default duration".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoids a crash if OpenSSL tries to write to a broken connection with
write().
Obviously OpenSSL really should use send() with MSG_NOSIGNAL, but for
some reason it doesn't. This should probably be considered an OpenSSL
bug, but since in this case we "own" the process, there is no harm in
ignoring the signal.
This is not done with libmpv, because as a library we don't want to mess
with global state. It's also not done if terminal handling is disabled -
this is a bit arbitrary, but I don't care much.
|
|
|
|
|
|
| |
This way, no surfaces are in use when uninitializing the hw decoders,
which might help with -copy hw decoders (normal hw decoding is not
affected).
|
|
|
|
|
|
|
|
|
| |
It's passed with the '--format' option to youtube-dl.
If it isn't set, we don't pass '--format best' so that youtube-dl can
use the options from its configuration file.
Signed-off-by: wm4 <wm4@nowhere>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This merely adds the file without using it, for the sake of retaining
authorship information.
Signed-off-by: wm4 <wm4@nowhere>
|
| |
|
|
|
|
| |
This was requested on IRC.
|
| |
|
|
|
|
|
|
| |
As suggested in #1241; to make using the feature easier.
Also add better OSD-formatting for the ab-loop-a/b properties.
|
|
|
|
|
|
| |
If the B point is set, then loop back to A.
Also, update the OSD bar if necessary.
|
|\
| |
| |
| | |
oops
|