0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00
Commit Graph

39730 Commits

Author SHA1 Message Date
ChrisK2
67f775bfbb ytdl: bump requrired youtube-dl version to 2014.11.26 2014-11-26 17:41:15 +01:00
ChrisK2
13845cf6fe 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-11-26 17:36:23 +01:00
ChrisK2
07ddfd4f8a ytdl: When using DASH, print actual duration
prints the actual duration as reported by youtube-dl to the
terminal when available
2014-11-26 17:17:05 +01:00
Timothy Gu
a6056c52fe DOCS/crosscompile-mingw: update
Add `.static` for MXE targets.

Signed-off-by: wm4 <wm4@nowhere>
2014-11-26 11:48:36 +01:00
Alessandro Ghedini
134d2475e6 manpage: lua: fix typo paramater -> parameter 2014-11-26 00:08:36 +01:00
wm4
9479daa13e demux_lavf: set PTS of first packet for formats with no timestamps
Makes time display work for some raw audio formats (*.shn).
2014-11-25 19:08:23 +01:00
wm4
5b69b76609 ao_alsa: fix channel map in pre-channel map API case
Forgotten in commit 5d5f5b09.
2014-11-25 18:34:24 +01:00
wm4
e1ae936e6b ao_alsa: always enable "plug" plugin for non-default device
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.
2014-11-25 18:15:45 +01:00
wm4
5d5f5b094b ao_alsa: select and set channel maps via channel map API
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.
2014-11-25 18:09:36 +01:00
wm4
5fb54fa756 ao_alsa: minor fixes
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.
2014-11-25 17:27:19 +01:00
wm4
78f59df6ed client API: make sure youtube-dl is not used by default
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.
2014-11-25 17:27:19 +01:00
Stefano Pigozzi
4590c198e6 cocoa: don’t hand over view memory ownership to libmpv clients 2014-11-25 14:45:13 +01:00
wm4
7d6e58471f audio: make mp_audio_config_to_str return a stack-allocated string
Simpler overall.
2014-11-25 11:11:31 +01:00
wm4
8a7b686597 ao_alsa: cleanups
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.
2014-11-25 11:10:44 +01:00
wm4
26190dbe57 player: add option not to use OSD/fontconfig
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.
2014-11-25 11:08:25 +01:00
wm4
28b6ce39d3 audio: make mp_chmap_to_str() return a stack-allocated string
Simplifies memory management.
2014-11-24 19:56:01 +01:00
wm4
2228d47373 ao_alsa: try to use the channel map reported by ALSA
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).
2014-11-24 19:44:26 +01:00
wm4
7561adb14d travis: restrict build matrix further
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.)
2014-11-24 18:42:27 +01:00
wm4
8178f842bf travis: add gcc to the build matrix
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?).
2014-11-24 16:56:48 +01:00
wm4
d33ae93b89 input: simplify 2014-11-24 16:48:34 +01:00
wm4
0c5fd5a047 lua: remove redundant call 2014-11-24 16:47:13 +01:00
wm4
89c1525585 lua: always handle key repeat on the script side
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).
2014-11-24 16:47:03 +01:00
wm4
2a017734a5 lua, ipc: remove leftovers
MPV_EVENT_SCRIPT_INPUT_DISPATCH is now unused/deprecated.

Also remove a debug-print from defaults.lua.
2014-11-24 10:33:55 +01:00
wm4
5bbd734fff command: don't queue framesteps
If repeated framestep commands are sent, just unpause the player, instead
of playing N frames for N repeated commands.
2014-11-23 15:31:32 +01:00
wm4
17ee2ca524 player: don't crash when using sub_seek without subtitles
Recent regression. It turns out the assertion was completely unneeded.

Fixes #1285.
2014-11-23 15:13:35 +01:00
wm4
ae5df9be98 input, lua: redo input handling
Much of it is the same, but now there's the possibility to distinguish
key down/up events in the Lua API.
2014-11-23 15:13:35 +01:00
wm4
7b47f12f8f client API: restrict client names
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 '_'.
2014-11-23 15:13:34 +01:00
wm4
9d91776d0d x11: fix crash
Broken by previous commit. Oops.
2014-11-23 13:58:03 +01:00
wm4
c9fdf4308c x11: fix crash with --wid=0 and vo_xv/vo_x11
But seriously, don't use --wid=0, don't use vo_xv, and _especially_
don't use vo_x11.

Fixes #1284.
2014-11-23 10:54:34 +01:00
wm4
4cdd346246 input: set mouse area by default for all input
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.
2014-11-23 09:10:51 +01:00
wm4
1eeca36d5f subprocess: minor cosmetic cleanup
Don't recursively include the whole stream.h header; only include what's
minimally needed, and handle the rest with forward declarations.
2014-11-22 14:38:58 +01:00
wm4
8097cee4c8 README: cleanup contact section
I spotted to the grammatically incorrect "it's", and ended up redoing
parts of the section.
2014-11-22 14:37:57 +01:00
James Ross-Gowan
ef0d1cddb6 lua: subprocess: move to osdep/subprocess-{win,posix}.c
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.
2014-11-22 18:15:13 +11:00
James Ross-Gowan
b2d0484404 manpage: update utils.subprocess() for Windows 2014-11-22 18:15:12 +11:00
James Ross-Gowan
060bf43d02 lua: subprocess: use macros for SetHandleInformation
Apparently both parameters refer to the same set of flags (the first is
a mask for which flags to set.)
2014-11-22 18:15:11 +11:00
James Ross-Gowan
d2848daebb lua: subprocess: fix handle inheritance race condition
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
2014-11-22 18:15:10 +11:00
James Ross-Gowan
6a1746b4e3 lua: subprocess: fix Ctrl+C handling on Windows
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.
2014-11-22 18:15:09 +11:00
James Ross-Gowan
f2b94a3b49 lua: subprocess: cancel pending I/O before return
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.
2014-11-22 18:15:08 +11:00
Rudolf Polzer
92316eb740 TOOLS/idet.sh: Adjust for changes in FFmpeg.
Compatibility to older idet is preserved.
2014-11-22 08:13:26 +01:00
wm4
863a050258 parse_configfile: check quote termination properly
This is some terrible code; I blame MPlayer legacy.

Found by Coverity.
2014-11-21 10:09:45 +01:00
wm4
75f38dcc9a m_property: fix a typo
The wrong value was checked for an error. Oops.

Found by Coverity.
2014-11-21 10:09:38 +01:00
wm4
df43e2d22a ao_pcm: simplify
Also shuts up Coverity.
2014-11-21 10:09:38 +01:00
wm4
9d2aef048d ao_oss: check whether setting samplerate succeeds
Independent from whether the samplerate was accepted or adjusted, errors
returned by the ioctl are fatal errors.

Found by Coverity.
2014-11-21 10:09:26 +01:00
wm4
c6c46f5aa7 ao_lavc: fix setting up AVFrame pointers
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.
2014-11-21 10:09:25 +01:00
wm4
c01a62efbc af_scaletempo: use float division for rate
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.
2014-11-21 10:09:15 +01:00
wm4
86b521f7df Silence some Coverity warnings
None of this really matters.
2014-11-21 09:59:58 +01:00
wm4
e082c2c3df Remove some unneeded NULL checks
Found by Coverity; also see commit 85fb2af3.
2014-11-21 09:58:09 +01:00
wm4
38f4ec69d1 README: add Coverity status
Because it looks nice.
2014-11-21 06:01:20 +01:00
wm4
9a724f62ce draw_bmp: make code more obvious, remove assertion
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.
2014-11-21 05:56:55 +01:00
wm4
9df4e7c70e stream: fix endian swapping
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.
2014-11-21 05:18:16 +01:00