summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* af_lavcac3enc: error out properly if encoding failswm42016-07-311-0/+4
|
* af_lavcac3enc: fix aspects of AVFrame handlingwm42016-07-311-0/+3
| | | | | | | | | | We send a refcounted frame to the encoder, but then disrespect refcounting rules and write to the frame data without making sure the buffer is really writeable. In theory this can lead to reallocation on every frame is the encoder really keeps a reference. If we really cared, we could fix this by providing a buffer pool. But then again, we don't care.
* audio: make mp_audio_realloc[_min] ensure frame is writeablewm42016-07-311-1/+10
| | | | | | | | This is logical: the function makes sense only in situations where you are going to write to the audio data. To make it worse, av_buffer_realloc() also handles this situation, but only if the buffer size changes (simply because it can't realloc memory in use), so we have to explicitly force reallocation by unreffing the buffers first.
* ytdl: Error out with http_dash_segmentsRicardo Constantino2016-07-301-0/+4
| | | | Unsupported for now.
* options: add vp9 to --hwdec-codecswm42016-07-302-4/+4
|
* wayland_common: fix fullscreen image switching bugRostislav Pehlivanov2016-07-303-6/+4
| | | | | | | | | | | The problem was that when in fullscreen, switching between images did not issue a resize event, causing none of the images to be rendered correctly. This fixes the problem by issuing a resize event with the screen width and height. This commit also moves the zeroing of the events field to when it gets retrieved by mpv rather than randomly after a resize in the vo/backend code.
* wayland_common: prevent black bars on most non-native aspect ratiosRostislav Pehlivanov2016-07-301-0/+3
| | | | | | | | | ssurface_handle_configure()'s width and height are just hints given by the compositor, the application's free to not respect those strictly and to compensate for e.g. aspect ratio. This prevents crazy scenarios in which pictures with portrait aspect ratios have a huge black area to make them 16:9 or whatever the compositor feels like.
* demux_raw: s16be support was missing due to small typoEric Toombs2016-07-301-1/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* wscript: add proper non-version'd SONAME for AndroidJan Ekström2016-07-301-1/+7
| | | | | This seems to have become a requirement since API target 23+, and matches what FFmpeg does.
* build: add --htmldir optionChris Mayo2016-07-302-1/+2
| | | | | Defaults to docdir but makes it possible to install html documentation separately.
* wayland_common: clip window size to the display output sizeRostislav Pehlivanov2016-07-301-5/+7
| | | | | | | | With X11 it was usually left up to the window manager to prevent huge windows from being out of range, but no Wayland compositor will do this right now. Hugely improves usability when using mpv as an image viewer.
* wayland_common: flush wakeup_pipe on a wakeupRostislav Pehlivanov2016-07-301-8/+10
| | | | | | Missed during the recent changes. Also simplify error checking code and check for POLLNVAL as well (the display fd was never actually checked to be valid).
* osdep/io: introduce mp_flush_wakeup_pipe()Rostislav Pehlivanov2016-07-305-10/+14
| | | | Makes a fairly common occurence with wakeup_pipes easier to handle.
* wayland_common: remove untested/unusable wayland dnd codeRostislav Pehlivanov2016-07-302-188/+1
| | | | | Not worth keeping 200 lines of untestable as of today code which might be broken, if it hasn't been already.
* vo_opengl: remove the 3dlut-size npot2 restrictionNiklas Haas2016-07-253-3/+4
| | | | | | | | This requires changing the pixel upload alignment because the odd sizes might not be aligned to multiples of 4. Anyway, the restriction has no real benefit and the sizes in between 32 and 64 might be worth using, so just drop it.
* vo_opengl: reduce default 3dlut-size to 64x64x64Niklas Haas2016-07-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Following testing after ebe798a, this is a more than sufficient size to cover our use case. The old default was a drop of about 58 dB PSNR using the old code, and this new default is about 65 dB PSNR, so it's actually an improvement despite resulting in a smaller size. There was no outlier whatsoever when comparing sizes around the 64 neighbourhood (with every step corresponding to a PSNR drop of about 0.07 dB), so I picked this since it's a power of two and requires no change to the current 3dlut-size parsing logic. I also tested smaller sizes such as 32x32x32 which performed almost as well on colorful samples, but this results in noticeable black boost in the dark regions, which is pretty undesirable. Therefore, we should avoid going much further below 64x64x64. Either way, this new size is so fast to compute that the 3dlut cache is almost useless on my end. In fact, it might even be slower to load the profile from the cache than to recompute it from scratch. (For caches on a disk. For cache on a tmpfs, it makes no difference)
* x11: do not accidentally discard event flagswm42016-07-252-6/+5
| | | | | | | | | It seems vo_x11_check_events() was supposed to return the currently flagged events and reset them. But there are many places where vo_x11_check_events() is called without checking its return value. This could lead to forgotten events. Change the code such that they can't get lost.
* vo_opengl: increase 3DLUT accuracy at lower LUT sizesNiklas Haas2016-07-251-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | This code had the exact same texture indexing bug that the original scaler code had before the introduction of the LUT_POS macro to fix it. We can re-use this same macro here, and the performance drop is virtually entirely negligible. The benefit is greatly improved LUT accuracy as the 3DLUT size decreases - in particular, the old LUT started introducing more and more black crush the lower your LUT size is (because the error was essentially an over-contrast bias, with a magnitude linearly related to the lut size). The new code improves black stability as the LUT size decreases, and only at very low values (16 and below) do black levels start noticeably getting affected (due to crude linearization of the nonlinear response curve). The default value of 3dlut-size is definitely generous enough for this to make no difference out of the box, but it also causes no performance drop at all on my machine so I see no harm in improving the logic. Furthermore, this means we could easily decrease the default 3dlut size in a future commit, perhaps even down to 64x64x64 as a default. (But more testing is warranted here)
* audio: use idiotic FFmpeg ABI rules for public-except-not-public fieldswm42016-07-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FFmpeg API is incredibly weird and inconsistent about this. This is also a FFmpeg-only issue and nothing like this is in Libav - which doesn't really show FFmpeg in a very positive light. (To make it even worse: this is a full-blown Libav API incompatibility, even though this crap was added for Libav ABI-compatibility. It's absurd.) Quoting the FFmpeg header for the AVFrame.channels field: /** * number of audio channels, only used for audio. * Code outside libavutil should access this field using: * av_frame_get_channels(frame) * - encoding: unused * - decoding: Read by user. */ int channels; It says "should" not must, and it doesn't even mention av_frame_set_channels(). It's also in the section for public fields (not below a marker that indicates private fields in a public struct, like it's done e.g. in AVCodecContext). But not using the accessor will cause silent failures on ABI changes. The failure that happened due to this code didn't even make it apparent what was wrong. So just use the idiotic accessor. Also harmonize the FFmpeg-cursing in the code. (It's fully justified.) Fixes #3295. Note that mpv will still check the exact library version numbers, and reject mismatches - to protect itself from such issues in the future.
* player: disable DS with spdif transcoding toowm42016-07-241-2/+5
| | | | | | Otherwise it behaves dumb. (Although you could argue it shouldn't try to guess whether speed changes work, but instead simply disable DS if they don't work.)
* af_lavcac3enc: use common code for AVFrame setupwm42016-07-243-16/+22
|
* demux_lavf: remove subtitle seeking special-casewm42016-07-241-22/+7
| | | | | | | | It used not to work - but now it apparently does. Not sure when that got fixed in FFmpeg, but there's no longer a reason to keep this hack. This also gets rid of the check for the read_seek2 field, which is not part of the public API.
* vo_opengl: glctx can be NULL during initwm42016-07-211-1/+1
| | | | | | | This fixes a crash that can happen with the Cocoa backend: it calls vo_wakeup() during init, which calls vo_opengl.c/wakeup(). Fixes #3360.
* x11, wayland: do not accidentally close FD 0wm42016-07-212-2/+6
| | | | | | | | | | Both backends have code to close each FD of their wakeup_pipe array. This array is default-initialized with 0, which means if the backends exit before the wakeup pipe is created (e.g. when probing), they would close FD 0. Initialize the FDs with -1. Then we call close(-1) in these situations, which is perfectly allowed and has no bad consequences.
* vo: remove now unused event_fd handlingwm42016-07-212-62/+8
|
* wayland_common: make function declaration consistentRostislav Pehlivanov2016-07-211-23/+21
| | | | Half the code had a space before the arguments and half didn't.
* wayland: port to the new wakeup/wait_events frameworkRostislav Pehlivanov2016-07-214-71/+53
| | | | | | | | | | | | This fits natively into the vo/backend and allows to simplify the polling code. One new change is the fact that surface_handle_enter flags VO_EVENT_WIN_STATE and VO_EVENT_RESIZE instead of only VO_EVENT_WIN_STATE. Before this, the code hackily relied on the timeout and the loop in the wait_frame function to track and set the scaling factor. Instead, this triggers mpv to run a schedule_resize and adjust the new VO output dimensions immediately. This is also more accurate since surface_handle_enter() gets called when a surface is created, moved and resized, which is exactly what the rest of the player might be interested in.
* manpage: not-document tscale=linearwm42016-07-211-0/+3
|
* vo_opengl: add a tscale=linear direct implementationNiklas Haas2016-07-211-3/+10
| | | | | | | | | | This uses GLSL mix() instead of going through an indirect texture access. Easy to implement and might require less resources on some devices, since the oversample code was already essentially just a special case of this. Could be made the new default (as per issue #2685), but that should be done in a separate commit.
* cocoa: remove unused icc profile variablesAkemi2016-07-211-2/+0
|
* cocoa: update screen fps only if necessaryAkemi2016-07-211-1/+3
| | | | | we don't need to update the display refresh rate when going fullscreen or updating the colour profile
* x11: stop using vo.event_fdwm42016-07-208-1/+72
| | | | Instead let it do its own event loop wakeup handling.
* vo_opengl: allow backends to provide callbacks for custom event loopswm42016-07-206-17/+51
| | | | | | | Until now, this has been either handled over vo.event_fd (which should go away), or by putting event handling on a separate thread. The backends which do the latter do it for a reason and won't need this, but X11 and Wayland will, in order to get rid of event_fd.
* vo_wayland: fix high CPU usage due to busy pollingRostislav Pehlivanov2016-07-191-3/+3
| | | | | | There's no need to call wl_display_flush() since all the client-side buffered data has already been flushed prior to polling the fd. Instead only check for POLLIN and the usual ERR+HUP.
* x11: skip ICC update on every window movewm42016-07-182-11/+26
| | | | | | | Don't just cause vo_opengl to update the ICC profile every time the window is moved. Instead, explicitly check if the screen was changed. Mostly untested.
* libarchive: sanitize non-UTF8 archive entrieswm42016-07-181-2/+2
| | | | | | | | | Some client API users simply don't like such filenames. For their sake, don't return them, but return a dummy filename instead. (Returning a latin1-ized version would work too, but is slightly more work.) Also remove the "\n" from the replacement dummy filename. This was accidental.
* libarchive: unify entry iteration between stream/demux layerswm42016-07-183-42/+54
| | | | No really good reason to duplicate this.
* audio: refactor mixer code and delete mixer.cwm42016-07-1714-225/+99
| | | | | | | | | | | | | | | | | mixer.c didn't really deserve to be separate anymore, as half of its contents were unnecessary glue code after recent changes. It also created a weird split between audio.c and af.c due to the fact that mixer.c could insert audio filters. With the code being in audio.c directly, together with other code that unserts filters during runtime, it will be possible to cleanup this code a bit and make it work like the video filter code. As part of this change, make the balance code work like the volume code, and add an option to back the current balance value. Also, since the balance semantics are unexpected for most users (panning between the audio channels, instead of just changing the relative volume), and there are some other volumes, formally deprecate both the old property and the new option.
* audio: fix crashes due to broken uninit checkwm42016-07-151-5/+0
| | | | | | Since mixer->ao is always NULL now (it was really just forgotten to be removed), the uninit call never actually cleared the af field, leaving a dangling pointer that could be accessed by volume control.
* vf_vavpp: get rid of mp_refqueue_is_interlaced()wm42016-07-153-11/+1
| | | | | | | | | This makes the difference between passing VA_FRAME_PICTURE or VA_BOTTOM_FIELD for progressive frames (that should be force- deinterlaced) to VAProcPipelineParameterBuffer.flags. VA-VPP doesn't really seem to care, and we can get rid of mp_refqueue_is_interlaced() entirely. It could be argued it's better to pass field flags instead of the progressive flag.
* vf_d3d11vpp: fix interlaced-only=no modewm42016-07-151-2/+2
| | | | | | "Real" frame flag vs. what we pretend it to be. It always used the real flag, and thus never deinterlaced unflagged frames, even if the suboption was set to "no".
* vf_d3d11vpp: add video processor selectionwm42016-07-152-5/+26
| | | | | Unfortunately completely useless. I still don't know how to force a video processor to use a specific algorithm, if it's even possible.
* player: do not cut off terminal status line if it contains newlineswm42016-07-151-1/+1
| | | | | | | Just a heuristic to preserve the status line in odd corner cases. Probably a crap idea. Fixes #3340.
* af: avoid rebuilding filter chain in another minor casewm42016-07-151-0/+3
| | | | | No need to create additional noise of we can trivially see that rebuiding the chain won't change anything.
* videotoolbox: add yuv420p to --videotoolbox-formatwm42016-07-152-2/+12
|
* vo_opengl: hwdec: reset hw_subfmt fieldwm42016-07-158-0/+9
| | | | | | In theory, mp_image_params with hw_subfmt set to non-0 if imgfmt is not a hwaccel format is invalid. (It worked fine because nothing checks this yet.)
* video: change hw_subfmt meaningwm42016-07-156-26/+22
| | | | | | | | | | | | | | | | | | The hw_subfmt field roughly corresponds to the field AVHWFramesContext.sw_format in ffmpeg. The ffmpeg one is of the type AVPixelFormat (instead of the underlying hardware format), so it's a good idea to switch to this too for preparation. Now the hw_subfmt field is an mp_imgfmt instead of an opaque/API- specific number. VDPAU and Direct3D11 already used mp_imgfmt, but Videotoolbox and VAAPI had to be switched. One somewhat user-visible change is that the verbose log will now always show the hw_subfmt as image format, instead of as nonsensical number. (In the end it would be good if we could switch to AVHWFramesContext completely, but the upstream API is incomplete and doesn't cover Direct3D11 and Videotoolbox.)
* man: fix PDF build errorMartin Herkt2016-07-151-0/+1
| | | | | | | ReportLab really doesn’t like breaking inline literals, so insert an explicit line break. Fixes #3338
* videotoolbox: add --hwdec=videotoolbox-copy for h/w accelerated decoding ↵Aman Gupta2016-07-155-9/+118
| | | | with video filters
* DOCS/compile-windows.md: MSVC DLL usage instructionswm42016-07-141-0/+18
|
* Use - as command-name separator everywhereTimotej Lazar2016-07-1417-47/+47
| | | | | | | Old-style commands using _ as separator (e.g. show_progress) were still used in some places, including documentation and configuration files. This commit updates all such instances to the new style (show-progress) so that commands are easier to find in the manual.
* demux_timeline: restore mkv edition switchingwm42016-07-141-0/+3
|
* ao_pulse: fix some volume control rounding issueswm42016-07-141-2/+3
| | | | | Volume could get easily "stuck" or making too huge steps when doing things like "add ao-volume 1".
* ao_creoaudio: print OSStatus as decimal signed integer toowm42016-07-131-1/+1
| | | | | OSStatus is quite inconsistent. Sometimes it's a FourCC, sometimes it reads as decimal signed number.
* ao_coreaudio: use correct free function on errorswm42016-07-131-1/+1
|
* manpage: add some missing color management related sub-propertieswm42016-07-131-0/+3
|
* command: add properties for HDR metadataNiklas Haas2016-07-132-0/+8
| | | | | | | | | Since it turns out that knowing what exactly a file was tagged with can be useful for debugging purposes, expose this as a property so I can check it more easily. This is mostly useful for sig-peak (since nom-peak is currently entirely calculated by us), but I added both for consistency.
* video: respect --deinterlace=autowm42016-07-121-1/+2
| | | | | | | | | | | | | | | | | | | | --deinterlace=auto is the default, and has the obscure semantics that deinterlacing is disabled, unless the user has manually inserted a deinterlacing filter. While in software decoding this doesn't matter, and we will happily insert 2 yadif filters (if the user has already added one), or not remove the yadif filter (if deinterlacing is disabled, but the user has added the filter manually), this is different with hardware deinterlacer filters. These support VFCTRL_SET_DEINTERLACE for toggling deinterlacing filtering at runtime. It exists mainly for legacy reasons, and possibly because it makes switching deinterlacing modes more efficient. It might also gives us an entry-point for VO deinterlacing, maybe. For whatever reasons this mechanism exists, we still support and use it. This commit fixes that video.c always used VFCTRL_SET_DEINTERLACE to disable deinterlacing, even if --deinterlace=auto was set. Fix this by checking the value of the option directly.
* win32: mpv.rc: re-add version infoJames Ross-Gowan2016-07-121-7/+25
| | | | | | | | | | | | | | | | For some reason, the lack of version info was preventing mpv from appearing in the Default Programs dialog. Re-add it, but don't set the string version numbers from version.h, because that's what was causing trouble when the version info was removed. Like the binary version numbers, these are now hardcoded to 2.0.0.0, which probably doesn't matter. The new version info block is also slightly different to the old one. It fills out all the binary VERSIONINFO fields and makes better use of macros. It also removes the \000 line terminators from the string version info, since as far as I can tell, this was just cargo-culting for an old broken version of the Microsoft resource compiler, and binutils' windres terminates the strings properly without them.
* vo_opengl: angle: use WARP if there are no hw adaptersJames Ross-Gowan2016-07-121-2/+45
| | | | | | | | | | | | | | | This should get mpv working on Windows 7 machines without hardware accelerated graphics adapters. It already worked on Windows 8 and up because those systems would silently fall back to WARP if there was no graphics hardware installed. The normal MPGL_CAP_SW flag is not set, so unlike other opengl backends, this will choose a software adapter even if opengl:sw is not specified. The reason for this is, unlike on Linux, where vo_xv and vo_x11 can be used, mpv on Windows does not have any VO to fall back on when hardware acceleration isn't available, so if software adapters are rejected, the user won't see any video output when using the default settings. WARP seems to perform quite well, so it should be used in this case.
* cache: minor simplificationwm42016-07-111-7/+10
| | | | | Every cache_wakeup_and_wait() caller has to deal with asynchronous stream abort, so why not make it somehow part of the function.
* cache: fix previous commitwm42016-07-111-1/+11
| | | | | | | | | | | The cache reader thread actually unlocks the mutex protecting the underlying stream while reading from it. That's why other code goes out of its way to run certain stream operations on the cache thread. Do the same. We could have this simpler by creating a mechanism that would "park" the cache thread and make it wait for the lock (while we have it) in order to gain exclusive access. This could be done in the future.
*