summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vo_opengl: refactor shader generation (part 1)wm42015-03-1212-2000/+1280
| | | | | | | | | | | | | | | | | | | The basic idea is to use dynamically generated shaders instead of a single monolithic file + a ton of ifdefs. Instead of having to setup every aspect of it separately (like compiling shaders, setting uniforms, perfoming the actual rendering steps, the GLSL parts), we generate the GLSL on the fly, and perform the rendering at the same time. The GLSL is regenerated every frame, but the actual compiled OpenGL-level shaders are cached, which makes it fast again. Almost all logic can be in a single place. The new code is significantly more flexible, which allows us to improve the code clarity, performance and add more features easily. This commit is incomplete. It drops almost all previous code, and readds only the most important things (some of them actually buggy). The next commit will complete it - it's separate to preserve authorship information.
* build: simplify windows checkswm42015-03-112-25/+14
| | | | | There's no reason to do finegrained checks for libraries which always must be present. It also reduces the number of extra dependencies.
* player: dump list of satisfied deps instead of config.h with -vwm42015-03-112-2/+12
| | | | | | Starting to get tired of seeing the full config.h in verbose output every time. Make it slightly more elegant by outputting the list of satisfied dependencies instead.
* demux_mkv: make matroska.pl script output deterministicwm42015-03-111-1/+1
| | | | | | Work around the randomized Perl hashtables by sorting the elements. Fixes #1673.
* command: allow changing some VO options even if VO wasn't created yetwm42015-03-111-4/+4
| | | | | | | | | | | | Instead of refusing to set properties like "fullscreen" if no VO was created, always allow it. So if no VO is created, setting the property merely changes the options (and will be applied once the VO is created). This is consistent with similar behavior changes to some other properties. Improves the behavior reported in #1676. Also, we shouldn't check the config_ok variable - the VO should do this.
* player: fix crash when taking screenshots in idle modewm42015-03-111-0/+2
| | | | | | | | | | mpctx->filename is obviously not set if no file is playing. When this code was written, it probably couldn't happen, because the normal screenshot path fails much earlier in idle mode. But you can still take screenshots in "full window" mode, and recently the screenshot code was changed to use the "full window" mode if the normal path does not work.
* x11: ignore mouse enter/leave events due to pointer grabwm42015-03-111-0/+4
| | | | | | | | | | | If you click on a window that doesn't have a focus, a LeaveNotify followed by a EnterNotify event can be generated. The former will have mode set to NotifyGrab, the latter to NotifyUngrab. This will make the player think the mouse left the window, even though this is not the case. Ignore these and only react to those with mode set to NotifyNormal. Probably fixes #1672, and some other strange issues on some WMs.
* build: disable tests by defaultStefano Pigozzi2015-03-101-0/+1
| | | | | Having them autodetect is a bad idea since it would link cmocka in the main mpv binary (which users don't want).
* vo: hide opengl-cb in --vo=helpwm42015-03-101-1/+1
| | | | Avoids stupid questions.
* audio: fix spdif packet size unitwm42015-03-102-9/+9
| | | | | | | | | | | In commit 5f8b060e I blindly assumed that the packet sizes were in pseudo-samples, but they were actually in bytes. Oops. (The effect was that cutting the audio was a bit less precise than it can be.) Also remove the packet size from ad_spdif.c; it didn't actually use it, and simply takes what the spdif "muxer" returns.
* audio: fix spdif DTS packet sizewm42015-03-101-0/+1
| | | | Broken in one of the previous commits.
* audio: cut audio with spdif too on playback restartwm42015-03-101-3/+3
| | | | | | | | | | | | | | | | | | | When playback is started after seeking or opening a file, we need to make sure audio and video line up exactly. This is done by cutting or padding the audio stream to start on the video PTS. This does not quite work with spdif: audio is compressed data, within a spdif frame. There is no way to cut the audio "in between" the frames. Cutting between the frames would just produce broken spdif packets, and who knows how receivers will react to this (play noise?). But we still can cut it in frame boundaries. Unfortunately, we also insert 0 data for "silence" - we probably shouldn't do this. Chances are the receiver will switch to PCM or so. But for now this will have to do. Note that this could be simplified somewhat, as soon as we work with frames. See previous commit.
* ad_spdif: move frame sizes to a general functionwm42015-03-103-7/+16
| | | | | | Needed for the next commit. This commit should probably be reverted as soon as we're working with full audio frames internally, instead of "flat" FIFOs.
* command: add display-fps propertywm42015-03-102-1/+24
| | | | Requested. Untested; leaving that to the users.
* vo_opengl_cb: clear last video frame on uninit()wm42015-03-101-8/+9
| | | | | | | | | | | | mpv_opengl_cb_render() is supposed to clear the screen with the background color if there's no video... I think. It didn't do this, because although uninit() requested gl_video_config() to be called, this didn't happen, because this function checks whether the VO is set - and it's unsert after uninit() releases the lock. Also call the user wakeup callback in this situation, so the user actually redraws immediately.
* ao_coreaudio_exclusive: port to pull API, fix latency calculationswm42015-03-101-78/+37
| | | | | | | | | | | | | | Instead of maintaining a private ring buffer, use the generic support for audio APIs with pull callbacks (internally called AO pull API). This also fixes latency calculations: instead of just returning the ringbuffer status, the audio playback state is calculated better and includes interpolation. The main reason this wasn't done earlier was mid-stream format switching. The pull API can now handle it (in a way) by destroying and recreating the AO. This is a bit brutal, but quite simple. It's untested in this new AO, though. Some details might not be right, like how ot restores the old format when reloading.
* ao_coreaudio: move some helpers to utilswm42015-03-103-16/+20
| | | | Needed by ao_coreaudio_exclusive.c in the next commit.
* ao_coreaudio_exclusive: rip out pseudo volume controlwm42015-03-101-40/+1
| | | | | | | | | | | | | | | | | This could mute a digital passthrough stream by writing zeros. All other volume values did nothing. The comment about MPlayer dying hasn't been true in mpv for quite a while. It's even possible that it's fixed in upstream MPlayer. mpv will print a scary error message when trying to change volume with spdif, and continue normally. If we really want to mute by writing zeros, we should do it in a separate filter. But I'm not overly fascinated by this approach; is it even guaranteed receivers will not be confused by a stream of zeros? The main reason to remove this is that it's in the way of further cleanups.
* player: restore --dump-statswm42015-03-101-6/+6
| | | | | Since the recent refactoring, it was initialized _before_ the command line player options were set, and consequently could not be enabled.
* client API: clarify mpv_opengl_cb_render() viewport parameterwm42015-03-091-1/+4
| | | | | | | | | | | | Basically, the idea behind the vp parameter is broken - I guess the intention was to enable rendering to a specific subrectangle of the target framebuffer, but there's nothing to specify the actual target rectangle (the VO will still clear e.g. the borders between video and framebuffer borders). We're not going to keep the current semantics either with the upcoming rework of vo_opengl, so declare this for broken. Maybe we can introduce a function later which does this properly.
* vo_opengl: move minor helper to common codewm42015-03-093-10/+6
| | | | | The generic image format code should cary most of the "knowledge" about image formats.
* stream: use relaxed atomic loads for checking playback abortswm42015-03-091-1/+1
| | | | | | | Seems appropriate, and will probably avoid performance surprises with scary architectures which don't have trivial implementations for atomic loads. (Consider that demux_mkv calls this very often now, and libavformat demuxers and streams did this for a while now.)
* demux_mkv: never warn when trying to resync on EOFwm42015-03-091-2/+4
| | | | | | If this happens, the file is actually broken, but the assumption is simply that the file was truncated, and printing a warning would be strange.
* demux_mkv: check for playback abortswm42015-03-093-0/+9
| | | | | | | | | Check async abort notification. libavformat already do something equivalent. Before this commit, the demuxer could enter resync mode (and print silly warning messages) when the stream stopped returning data because of an abort.
* w32_common: remove redundant is_maximized functionJames Ross-Gowan2015-03-091-8/+1
| | | | This already exists as IsMaximized in the Windows API.
* cocoa: fix minimized state getterStefano Pigozzi2015-03-091-5/+2
|
* x11: fix VOCTRL_GET_WIN_STATEwm42015-03-091-0/+1
| | | | | | | | | | Do not rely on the pointed-to argument to be initialized; VOCTRLs are supposed to completely overwrite them on success (or not to touch them on failure). The currently only caller of VOCTRL_GET_WIN_STATE initializes the value before calling this, so this is merely about correctness and didn't lead to any actual bugs.
* w32_common: support the "window-minimized" propertyJames Ross-Gowan2015-03-092-2/+6
|
* stream/smb: mark as network stream for --cache=autoKevin Mitchell2015-03-091-0/+1
| | | | | | | This causes the cache to be enabled with --cache=auto. It was not done previously because the small cache size 320k actually led to worse performance. However, with the current default cache size of 25000kb, caching notably improves performance.
* manpage: document swapinterval defaultNiklas Haas2015-03-091-1/+2
|
* cocoa: support the "window-minimized" propertyJaime Marquínez Ferrándiz2015-03-083-1/+33
| | | | Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
* vf_vavpp: fix deinterlacingFilip Milivojevic2015-03-081-0/+8
| | | | | | | Add filter parameters to VAAPI deinterlacing filter to actually process bottom fields instead of deinterlacing top field twice. Signed-off-by: wm4 <wm4@nowhere>
* input.conf: add key binding to override ASS subtitle styleswm42015-03-082-0/+8
|
* DOCS: minor update to coding stylewm42015-03-081-0/+2
|
* cocoa: fix autohide in fullscreenStefano Pigozzi2015-03-084-5/+26
|
* cocoa: fix mouse hiding with launchpad and dock foldersStefano Pigozzi2015-03-083-1/+18
| | | | | | | | | | | | Some UI elements in OS X – like Launchpad and Dock folders – are implemented using borderless windows in background demonized applications. When we use these elements, mpv doesn't stop to be the active application, but the mpv window leaves keyWindow state while we use the OS controls. This commit just keeps track of window state to update the cursor visibility accordingly. Fixes #513
* options: add M_OPT_FILE to new options that are missing itPhilip Sequeira2015-03-072-2/+2
| | | | Fixes shell completion.
* audio: refuse to change playback speed with spdifwm42015-03-072-3/+5
| | | | | | | | | | | | Handle the failure gracefully, instead of exploding and disabling audio. Just set the speed back to 1.0. Also remove the AF_DETACH from af_scaletempo. This actually created a dangling pointer in af_add(), a tricky consequence of af_add() reconfiguring the filter chain and the newly added filter using AF_DETACH. Fortunately the AF_DETACH is not needed (and probably never worked - it comes from MPlayer times, and MPlayer also disables audio when trying to change speed with spdif).
* audio: make changing playback speed slightly more robustwm42015-03-071-32/+39
| | | | | | | | | | | Always use af_scaletempo if it's inserted, even if the option --audio-pitch-correction=no is set. Make sure all filters are reset on speed change. It's conceivable that dynamic changes to the filter chain at runtime leave filters around without resetting their speed parameters. Also move the code to a separate function.
* cocoa: clamp mouse position to window.torque2015-03-071-0/+2
| | | | | Prevents out-of-window coordinates being reported for mouse coordinates. Previously they could be out-of-window coordinates on init or on resize.
* cocoa: update mouse coordinates when window is initialized.torque2015-03-073-2/+4
| | | | | | Make MpvEventsView -signalMousePosition a public method so it can be called without a compiler warning. Previously, the mouse position would be reported as (0,0) until the cursor was moved.
* cocoa: don't uninit light sensor if not presentStefano Pigozzi2015-03-071-2/+4
|
* vo_opengl/x11: fix automatic ICC profile loadingMartin Herkt2015-03-072-6/+11
| | | | | | | | | | | | mpv would attempt to load ICC profiles several times during VO init even if no window is displayed. This potentially causes it to load a profile for a different screen than it is going to be displayed on, thereby invalidating the profile cache and rebuilding the LUT every single time. It would not unload a previously loaded profile when the video window is moved to a display without an installed profile. Fix these issues and tweak the log messages a little.
* cocoa: remove possible use after freeStefano Pigozzi2015-03-071-5/+5
|
* cocoa: fix some crashes caused by async uninitStefano Pigozzi2015-03-071-31/+15
| | | | | | | Always keep around our private state and destroy it when we are really done in the async uninit callback. Fixes #1657
* af_scaletempo: minor simplificationwm42015-03-061-15/+6
|
* af_scaletempo: restore confusing mplayer behaviorwm42015-03-061-3/+9
| | | | | | | | | This matters only when setting obscure scaletempo suboptions. See #1653. (But what we really should do is figuring out how to do this in a sane way.)
* demux_mkv: actually skip elements out of reachwm42015-03-061-1/+2
| | | | | This is missing from the previous commit. Not that harmful, but also slightly un-nice since even a failed seek will reset the cache.
* demux_mkv: fix issues with unseekable streamswm42015-03-061-14/+16
| | | | | | | | | | | | | | | A user reported a webm stream that couldn't be played. The issue was that this stream 1. was on an unseekable HTTP connection, and 2. had a SeekHead element (wtf?). The code reading the SeekHead marked the element as unreadable too early: although you can't seek in the stream, reading the header elements after the SeekHead read them anyway. Marking them as unreadable only after the normal header reading fixes this. (The way the failing stream was setup was pretty retarded: inserting these SeekHead elements makes absolutely no sense for a stream that cannot be seeked.) Fixes #1656.
* Lua: add unpack shim for Lua 5.2/5.3 compatibility.torque2015-03-061-0/+2
| | | | | | | | | The global unpack function got moved to table.unpack in Lua 5.2, and it's only available as the global if 5.2 is built with compatibility enabled (the default). Lua 5.3 does not build with 5.1 compatibility by default. Fixes #1648.
* vo_vaapi: fix video equalizer (second try)wm42015-03-061-12/+36
| | | | | | | | | | | | The vaapi equalizer have a custom range, and can have a smaller range than mpv's normalized video equalizer values. The result is that a vaapi equalizer value can map to multiple mpv values, so changing a mpv value by 1 can get "stuck". Fix by remember the mpv value, and returning it if it still corresponds to the vaapi value. Really fixes #1647. (Why am I even bothering with this irredeemable crap?)
* player: allow changing playback speed in early audio init stageswm42015-03-061-1/+1
| | | | | | | | | If the audio decoder was created, but no audio filter chain created yet (still trying to decode a first audio frame), setting the "speed" property could explode. It tried to recreate the filter chain, even though no format was set yet. This is inconvenient and should not happen.
* DOCS/compile-window.md: add Lua package to MXE instructionswm42015-03-061-2/+2
| | | | The MSYS2 ones already mention Lua.
* build: make vdpau and dxva2 checks nicerwm42015-03-062-4/+4
| | | | | | Using check_statement() with an empty statement just to check for the header is quite a hack. Fix check_headers() (so it takes a "use" parameter), and use it for the checks instead.
* player: fix operation if command line is emptywm42015-03-062-12/+13
| | | | | | | main() being called with argc==0 is probably possible. Fix by skipping the program name early. (I already changed and reverted this once, but this time we make sure that it's less likely to confuse the skipped argv with main()'s argv by naming it "options".)
* osx: terminate argv properly when arguments are removedwm42015-03-061-1/+4
| | | | | | | The player now relies on the (slightly obscure) requirement that argv is NULL-terminated. Might fix #1652.
* DOCS, options: fix exampleChrisK22015-03-051-1/+1
|
* build: check whether hwaccels are enabled in FFmpegwm42015-03-051-3/+5
| | | | | FFmpeg can be compiled with them disabled, and then it won't provide the public headers specific to these APIs, causing mpv compilation failure.
* vo_opengl: make smoothmotion-threshold inclusiveNiklas Haas2015-03-051-2/+2
| | | | | This behavior makes more sense near the borders, eg. smoothmotion-threshold=0 and smoothmotion-threshold=0.5.
* vd_lavc: let --hwdec=auto select "vaapi-copy"wm42015-03-051-1/+1
| | | | | | | | | | | | Instead of "vaapi", simply by changing the probe order. "vaapi" uses the GLX GL interop, which has causing us more problems than it solved. Unfortunately this leads also to copying if "--hwdec=auto --vo=vaapi" is used, even though GLX is not involved in this case - but I don't care enough to make the probe logic cleverer just for this. You can still get the zero-copy path with --hwdec=vaapi.
* vd_lavc: request 1 more threads than CPU coreswm42015-03-051-0/+2
| | | | | | | | | | This duplicates the logic which FFmpeg's libavcodec uses. The effects are unknown, though it's somewhat clear that a single thread doesn't necessarily saturate a single CPU. (Eventually we should just let FFmpeg auto-init the thread count, but for now I prefer it this way, so e.g. verbose mode will print the thread count.)
* vo_vaapi: round equalizer valueswm42015-03-051-2/+5
| | | | | Probably fixes #1647 (if it's correct at all). I couldn't reproduce with the vdpau libva driver, but a driver can use different ranges.
* client API: mention the changes to the seek/screenshot commandswm42015-03-052-1/+3
| | | | Also fix a typo in the manpage.
* player, client API: refactor cplayer init, reduce client API differenceswm42015-03-055-51/+60
| | | | | | | | | | | | | Move the command line parsing and some other things to the common init routine shared between command line player and client API. This means they're using almost exactly the same code now. The main intended side effect is that the client API will load mpv.conf; though still only if config loading is enabled. (The cplayer still avoids creating an extra thread, passes a command line, and prints an exit status to the terminal. It also has some different defaults.)
* player: minor simplificationwm42015-03-053-16/+11
| | | | | argv is always terminated with a NULL, so we don't need to drag argc along. Simplifies the following commit a little bit.
* vo_opengl: increase ambient light changes log levelStefano Pigozzi2015-03-041-1/+1
| | | | info is a quite too annoying. increase it to verbose.
* README: fix typoswm42015-03-0