summaryrefslogtreecommitdiffstats
<
Commit message (Collapse)AuthorAgeFilesLines
* audio: make native channel count the default instead of stereo downmixwm42014-12-153-5/+35
| | | | | | | | | | | | | | This should work well with most audio APIs, except ALSA. A long-winded explanation is provided how to make ALSA multichannel output work. All other AOs should have no such problems. Of course it's possible that previously unknown issues arise, because I assume that enabling multichannel audio is actually relatively rare. This also disables codec downmix by default, which could change the audio output due to different mixing in the codec and libavresample. Fixes #1313.
* ao_alsa: remove old multichannel methodwm42014-12-151-49/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The "old" method (before the ALSA channel map API) used device aliases like "surround51" to set the channel layout. The "interesting" part was that these devices usually redirect to a hardware device. This means playing stereo would lead you to the "default" device (dmix), while e.g. 5.1 to "surround51", which automatically takes care of the fact that dmix can't do 5.1. This is pretty much nonsense, though. It shouldn't depend on the damn input media file whether the player is going to use shared access (dmix) or exclusive access (direct hw device). As a consequence, by default ao_alsa will do only what dmix can do. If the user actually wants multichannel, he has to select a suitable hw device with --audio-device. From there on, the correct speaker mapping will be ensured via the channel mapping API. The change is preparation for making multichannel output the default (as far as supported by the audio output API). Of the common APIs, only ALSA messes up beyond repair, so I feel like this change is needed. On ancient alsa-lib versions, only stereo and mono can be played with this branch.
* ao_alsa: add ridiculous hack to deal with braindead ALSA behaviorwm42014-12-151-3/+42
| | | | | | | | | | | | | | | | | | | | | dmix reports channel layouts it doesn't support. The rest of the technical part of the story is in the code comment. This seems to be the only reasonable way to fallback from trying to initialize certain devices (like dmix) with multichannel audio. We could probably add support for such padding channels to our audio chain or to ao_alsa itself, but this would probably be much more work than this commit. What dmix does is probably a bug. I've tried to report it to ALSA. Thay have a link on their website to a bug tracker, but it's a dead link, and has been for years. I've posted to alsa-devel, but received no reply. I'm thus assuming this absolutely retarded behavior is by design, and nothing will happen to improve upon it. I'm considering sending Lennart Poettering a "thank you" email, because with PulseAudio, multichannel audio just works (although some other things just don't work).
* client API: be more lenient about mpv_suspend/resume mismatcheswm42014-12-154-45/+57
| | | | | | | | | | | | Before this commit, this was defined to trigger undefined behavior. This was nice because it required less code; but on the other hand, Lua as well as IPC support had to check these things manually. Do it directly in the API to avoid code duplication, and to make the API more robust. (The total code size still grows, though...) Since all of the failure cases were originally meant to ruin things forever, there is no way to return error codes. So just print the errors.
* lua: cosmetics: fix some include directiveswm42014-12-151-3/+2
| | | | | | Apparently, the atomics were used by the win32 subprocess code. This code was moved to a separate file, but the atomics.h include was forgotten.
* ao/wasapi: set the ao with the waveformat channelmapKevin Mitchell2014-12-151-1/+10
| | | | hopefully this fixes #1350
* scripting: fix/improve deprecation messagewm42014-12-151-3/+6
| | | | | | | | | The message was missing a '\n', so it was merged with the next line, which also typically caused it not to be printed with the colors for warnings. Print the full new path in the warning message. (Normally, cfg should never be NULL, so accounting for this case is just for robustness.)
* vo_opengl: remove quadbuffer/anaglyph stereo 3D renderingwm42014-12-157-150/+96
| | | | | | | | Obscure feature, and I've never heard of anyone using it. The anaglyph effects can be reproduced with vf_stereo3d. The only thing that can't be reproduced with it is "quadbuffer", which requires special and expensive hardware.
* options: deprecate 'lua' based options/dirs for 'script'Avi Halachmi (:avih)2014-12-1513-47/+66
| | | | | | | | | | | | - --lua and --lua-opts change to --script and --script-opts - 'lua' default script dirs change to 'scripts' - DOCS updated - 'lua-settings' dir was _not_ modified The old lua-based names/dirs still work, but display a warning. Signed-off-by: wm4 <wm4@nowhere>
* vo_x11: don't attempt to resize when unconfiguredwm42014-12-141-2/+3
| | | | | | Fixes #1347. The previous commit actually fixes the crash.
* vo_x11: check allocation errorswm42014-12-141-3/+10
| | | | Avoids a crash if allocation fails.
* build: add checks for some compiler warning flagswm42014-12-141-8/+8
|
* vd_lavc: fix error handling pathwm42014-12-131-11/+12
| | | | The ctx->pic check must uninitialize the decoder.
* mp_image: check for malloc failurewm42014-12-131-0/+2
| | | | | Or rather, the only reason av_buffer_create() can fail is a malloc failure.
* command, dvd: add property which returns list of DVD titleswm42014-12-135-22/+123
| | | | | | | | | This was requested. It seems libdvdread can't get the duration for titlesets other than the currently opened title. The data structures contain dangling pointers for these, and MPlayer works this around by opening every title separately for the purpose of dumping the title list.
* stream_cdda: don't return number of tracks as number of titleswm42014-12-131-5/+0
| | | | | | Apparently, we treat different tracks as titles, so returning the number of titles (which is user-visible as "disc-titles" property) is completely misguided.
* dvd: drop last chapterwm42014-12-131-2/+2
| | | | | | | Apparently, libdvdnav always reports a last chapter that points to the exact end of the title. This is useless for us. Again, same possible caveats as with the previous commit.
* dvd: add an extra chapter at position 0wm42014-12-131-2/+2
| | | | | | | This way, chapter 0 will always point to the start of the title. At least this is the intention; it's likely that DVDs as well as libdvdnav do random things that lead to random results.
* osxbundle: don't use sed but pure pythonMihai Moldovan2014-12-131-1/+3
| | | | | | | | GNU sed and BSD sed don't share the same options for editing files in-place, so a workaround is needed. The most simple way is to use a pure python implementation of applying the changes.
* DOCS: add missing close bracketBen Boeckel2014-12-121-1/+1
|
* options: add option for ignoring patch in resume mechanismwm42014-12-134-4/+13
| | | | | | Whatever. Fixes #1281.
* player: add a --keep-open=always modewm42014-12-123-11/+26
| | | | | | | | The --keep-open behavior was recently changed to act only on the last file due to user requests (see commit 735a9c39). But the old behavior was useful too, so bring it back as an additional mode. Fixes #1332 (or rather, should help with it).
* options: fix parsing for --ab-loop-*wm42014-12-121-1/+1
| | | | Editing mistake. Oops.
* Check some mallocswm42014-12-122-0/+8
| | | | Fixes #1337.
* DOCS/crosscompile-mingw: updatewm42014-12-121-7/+15
| | | | Unrecommend mingw-w64-cmake, point out MXE host requirements.
* command: add properties for current bitratewm42014-12-124-1/+67
| | | | Fixes #1192.
* demux: don't always make --cache-secs override --demuxer-readahead-secswm42014-12-122-3/+8
| | | | It's confusing. Whether the new behavior is less confusing... whatever.
* options: make --no-... options work for OPT_REPLACED toowm42014-12-112-9/+24
| | | | | | | | Do this by automatically adding the option, if the aliased option name also has a "no-..." variant. Could be easier by manually adding "no-..." variants to the option list, but this seems better because you can't just forget it.
* DOCS/contribute.md: remove unintentional headlineselsta2014-12-111-2/+2
| | | | The # from the IRC channel made it appear as a headline.
* pipe-win32: possible fix for Windows XP deadlockJames Ross-Gowan2014-12-111-0/+10
| | | | | This fixes a hang with the VirtualBox OpenGL drivers. It might help with #1325 as well.
* manpage: fix mistake in --video-zoom mentionwm42014-12-111-1/+1
| | | | Fixes #1331.
* options: add slightly more sophistcated mechanism for option deprecationwm42014-12-116-92/+132
|
* lua: don't ignore key press events for script key bindingswm42014-12-101-2/+2
| | | | Meh.
* command: fix crash with some forms of script_bindingwm42014-12-101-1/+1
| | | | "script_binding name ..." just crashed it. Oops.
* player: update chapter marks when switching fileswm42014-12-101-0/+4
| | | | | This wasn't done, so the chapter marks of the previous file were visible. It's harmless, but looks unpolished, so fix it.
* player: set a specific window title in idle modewm42014-12-101-1/+1
| | | | Instead of "(unavailable)".
* m_option: never return NOPTS value as number from propertieswm42014-12-101-5/+36
| | | | | | | | MP_NOPTS_VALUE (basically INT64_MIN) is basically an special timestamp value that means "unset" or "unknown". Its exact value is internal, and should never be returned or interpreted by any API. So return "no" instead (what is also what the parser accepts).
* vo: fix some nonsensewm42014-12-104-11/+8
| | | | | | | | | Commit d38bc531 is incorrect: the 50ms queue-ahead value and the flip queue offset have different functions. The latter is about calling flip_page in advance, so the change attempted to show video frames 50ms in advance on all VOs. The change was for vo_opengl_cb, but that can be handled differently.
* command: add "idle" propertywm42014-12-102-2/+20
| | | | Yes, it's redundant with events.
* emux_mkv: fix possible uninitialized reads with short fileswm42014-12-101-1/+3
| | | | | | | | | | These actually are harmless. Even if the data the reader is working on is essentially random, it's treated like untrusted input data, so there should be no harm. But it upsets tools like valgrind. Probably fixes #1329.
* manpage: update the ao_alsa example (no-block was removed)wm42014-12-091-2/+2
| | | | | Also, don't use the "hw" device, but "plughw". ALSA docs say never to use "hw".
* DOCS/client_api_examples: remove nonsensewm42014-12-092-4/+3
| | | | | | | I thought setSamples() was some funky abstraction to set the number of components, but it's actually something else. Also fix the include paths.
* vo_opengl: fix linkage typewm42014-12-091-1/+1
| | | | Can happen on Windows, I suppose.
* vo_opengl: make shader text output slightly nicerwm42014-12-091-2/+2
| | | | It was missing an indentation in some cases.
* vo_opengl: don't crash if framebuffers are not availablewm42014-12-091-0/+9
| | | | | | | | | | | In theory, vo_opengl supports operation without framebuffers. But this has been broken for a while now (commit cc00b3ff is a contender). It crashed because it unconditionally called gl->BindFramebuffer() (which is NULL if framebuffers are missing). Since this function is actually only called to set the default framebuffer, the simplest way to deal with this is to provide a dummy function, insteas of uglifying the code with additional if branches.
* options: enable --ytdl by defaultwm42014-12-093-7/+4
| | | | Let's see who complains...
* player: change interaction between revert_seek and ab-loopswm42014-12-091-0/+1
| | | | | | The result isn't quite what I imagined, because the A-point is never marked as a seek point (so you can't jump between A and B), but it's still slightly better than before.
* vo_opengl_cb: simplify reconfigure, render transparent if unconfiguredwm42014-12-093-15/+18
| | | | | | | I think that's expected; mpv shouldn't draw anything while no video is active. This doesn't blend transparently, though. Also document the vo_opengl_cb thing.
* vo_opengl: make background color configurablewm42014-12-093-3/+15
| | | | | This mainly affects the black bars that are drawn if the window and video aspect ratios mismatch.
* options: --wid can be set at any timewm42014-12-091-1/+1
| | | | | | | | | | | | | After being bitten by this, I decided that this mostly unnecessary requirement sucks. Allowing this makes it easier to use libmpv, because it can be set after mpv_initialize(). The latest reasonable time an API user can set this variable is before actually loading a file. The previous 2 commits make sure nothing bad can happen if the option is changed at runtime even if a VO is active. The Cocoa backend should be fine and doesn't need a change.
* w32: copy WinID optionwm42014-12-091-14/+14
| | | | See previous and next commit.
* x11: copy WinID optionwm42014-12-092-16/+22
| | | | For the purpose of making "--wid" setable at any time.
* client API: expose OpenGL rendererwm42014-12-0928-25/+993
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds API to libmpv that lets host applications use the mpv opengl renderer. This is a more flexible (and possibly more portable) option to foreign window embedding (via --wid). This assumes that methods like context sharing and multithreaded OpenGL rendering are infeasible, and that a way is needed to integrate it with an application that uses a single thread to render everything. Add an example that does this with QtQuick/qml. The example is relatively lazy, but still shows how relatively simple the integration is. The FBO indirection could probably be avoided, but would require more work (and would probably lead to worse QtQuick integration, because it would have to ignore transformations like rotation). Because this makes mpv directly use the host application's OpenGL context, there is no platform specific code involved in mpv, except for hw decoding interop. main.qml is derived from some Qt example. The following things are still missing: - a way to do better video timing - expose GL renderer options, allow changing them at runtime - support for color equalizer controls - support for screenshots
* vo: include normal render-ahead time in flip_queue_offsetwm42014-12-093-9/+13
| | | | | | A small refactor; shouldn't change any behavior. Do this so immediate display can be achieved.
* w32_common: fix GUID linking in CygwinJames Ross-Gowan2014-12-091-0/+1
|
* player: restore ab-loop settings with playback resumewm42014-12-091-0/+2
| | | | Fixes #1324.
* cocoa: fix crashStefano Pigozzi2014-12-081-5/+0
| | | | | | fixes #1323 Doesn't leak unless we switch video tracks on and off while in fullscreen.
* input.conf: add example for aspect ratio cyclingwm42014-12-081-0/+2
| | | | | This is requested oftem, but I don't know if it should be an actual default binding.
* demux_mkv: support svq3wm42014-12-081-14/+24
| | | | | | | | | | The most awesome codec, not. The actual code for svq3 is actually just the part that checks for MKV_V_QUICKTIME (no other QT-muxed codecs are supported). The rest is minor refactoring, that actually improves the code in general. This is just enough to support the 2 svq3-in-mkv sample files I have.
* build: fix --disable-libasswm42014-12-081-2/+2
| | | | | | Still supported, but obviously untested. You shouldn't use this option anyway.
* player: make chapter seek to end jump to last frame with --keep-openwm42014-12-083-2/+7
| | | | | | | | There were complaints that a chapter seek past the last chapter was quitting the player. Change the behavior to what is expected: the last frame. If no chapters are available, this still does nothing.
* vo_opengl: enable fancy-downscaling for opengl-hq againwm42014-12-081-1/+1
| | | | | | I guess most problems with it have been fixed. It's still slower than necessary, though.
* vo_opengl: use all filter sizes possible with the shaderswm42014-12-082-33/+21
| | | | | | | | | | | | | | Not all filter sizes the shaders could handle were in the filter_sizes list. The shader can handle any multiple of 4 (the sizes 2 and 6 are special-cased to keep it simple). Add all possible filter sizes, up to 64. 64 is ridiculously high anyway. Most of the larger filter sizes are completely useless for upscaling, but help with the fancy-downscaling option. (Although it would still be more efficient to use cascaded scalers to handle downscaling better.) I considered doing something less stupid than the hardcoded array, but it seems this is still the simplest solution.
* vo_opengl: refactor: instantiate scaler functions at runtimewm42014-12-082-44/+43
| | | | | | | | | | | | | | | | | Before this commit, the convolution scaler shader functions were pre- instantiated in the shader file. For every filter size, a corresponding function (with the filter size as suffix) had to be present. Change this, and make the C code emit the necessary bits. This means the shader code is much reduced. (Although hopefully it doesn't make shader compilation faster - it would require a really dumb compiler if it spends its time on dead code.) It also makes it more flexible, which is the main goal. The DEF_SCALER0 stuff is needed because the C code writes the header of the shader, at a point where scaler macros are not defined yet.
* vo_opengl: never use 1D textures for lookup textureswm42014-12-082-48/+35
| | | | | | | | | This was a microoptimization for small filters which need 4 or less weights per sample point. When I originally wrote this code, using a 1D texture seemed to give a slight speed gain, but now I couldn't measure any difference. Remove this to simplify the code.
* vo_opengl: refactor: merge convolution function and sampler entrypointwm42014-12-081-67/+36
| | | | | | | | | There's not much of a reason to have the actual convolution code in a separate function. Merging them actually simplifies the code a bit, and gets rid of the repetitious macro invocations to define the functions for each filter size. There should be no changes in behavior or output.
* w32_common: ensure taskbar is hidden when fullscreenJames Ross-Gowan2014-12-081-2/+28
| | | | | | | | | | | | | | | Windows uses a heuristic to determine if a window should appear fullscreen. If the active window's client area covers the whole screen, the taskbar should move to the bottom of the Z-order, allowing the window to show through. Unfortunately, sometimes it doesn't work and the taskbar stays on top of the "fullscreen" window. ITaskbarList2->MarkFullscreenWindow explicitly tells the shell that a window wants to be fullscreen, so the taskbar is always at the bottom of the Z-order while the marked window is active. This might help with #999. Firefox also uses this interface to fix fullscreen issues.