summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Release 0.26.0v0.26.0Martin Herkt2017-07-182-1/+144
|
* csputils: fix mp_colorspace_equal missing fieldNiklas Haas2017-07-181-0/+1
| | | | Forgot to equality test for mp_colorspace.light
* manpage: upcase JavaScript for section title case consistency.torque2017-07-171-1/+1
|
* vo_opengl: avoid constant divisionsNiklas Haas2017-07-172-40/+42
| | | | | | | These are apparently expensive on some drivers which are not smart enough to turn x/42 into x*1.0/42. So, do it for them. My great test framework says it's okay
* demux_disc: fix bluray subtitle language retrievalwm42017-07-161-4/+4
| | | | | | | | | It seems like adjusting the raw stream ID should be done only for DVD. Otherwise, getting the subtitle language for Bluray breaks. Untested. Regression since fb9a32977d6. Fixes #4611 (probably).
* vo_opengl: styleNiklas Haas2017-07-161-1/+1
| | | | Use uintptr_t instead of size_t. Shouldn't matter, but is cleaner.
* vo_opengl: use MP_ALIGN_UP instead of FFALIGNNiklas Haas2017-07-161-1/+1
| | | | Consistency/style
* vo_opengl: use glBufferSubData instead of glMapBufferRangeNiklas Haas2017-07-164-27/+10
| | | | | | | | | | | | | | | | | | | | Performance seems pretty much unchanged but I no longer get nasty spikes on NUMA systems, probably because glBufferSubData runs in the driver or something. As a simplification of the code, we also just size the PBO to always have the full size, even for cropped textures. This seems slower but not by relevant amounts, and only affects e.g. --vf=crop. It also slightly increases VRAM usage for textures with big strides. This new code path is especially nice because it no longer depends on GL_ARB_map_buffer_range, and no longer uses any functions that can possibly fail, thus simplifying control flow and seemingly deprecating the manpage's claim about possible image corruption. In theory we could also reduce NUM_PBO_BUFFERS since it doesn't seem like we're streaming uploads anyway, but leave it in there just in case some drivers disagree...
* ytdl_hook: add a header to support geo-bypassJagannathan Tiruvallur Eachambadi2017-07-161-1/+1
| | | | | | youtube-dl supports bypassing some geographic restrictions by setting X-Forwarded-For header when used with geo-bypass and geo-bypass-country.
* osd_libass: avoid libass warnings if scripts set ASS text earlywm42017-07-162-19/+30
| | | | | | | | | | | | | | | | Lua scripts can call osd_set_external() early (before the VO window is created and obj->vo_res is filled), in which case the PlayResX field would be set to nonsense, and libass would print a pointless warning. There's an easy and a hard fix: either just go on and pass dummy values to libass (basically like before, just clamp them to avoid the values which make libass print the warning). Or attempt to update the PlayRes field to correct values on rendering (since at rendering time, you always know the screen size and the correct values). Do the latter. Since various things use PlayRes for scaling things, this might still not be fully ideal. This is a general problem with the async scripting interface.
* Replace remaining avcodec_close() callswm42017-07-166-27/+7
| | | | | | | | This API isn't deprecated (yet?), but it's still inferior and harder to use than avcodec_free_context(). Leave the call only in 1 case in af_lavcac3enc.c, where we apparently seriously close and reopen the encoder for whatever reason.
* vo_opengl: update BufferData usage hintsNiklas Haas2017-07-151-2/+11
| | | | | | | | | | | | | | | STREAM is better than DYNAMIC because we're only using it once per frame. As for COPY vs DRAW, that was pretty much incorrect to begin with - but surprisngly, COPY is actually faster (sometimes significantly so, e.g. on my NUMA system). After testing, the best I can gather is that it has to do with the fact that COPY requires fewer redundant memcpy()s, and also 3x reduce RAM bandwidth (in theory). Anyway, that bit shouldn't introduce any regressions, it's just a documentation update. Maybe I'll change my mind about the comment again the future, it's really hard to tell. Vulkan, please save us!
* vo_opengl: coalesce intra-plane PBOsNiklas Haas2017-07-152-14/+17
| | | | | | | | | | | | | | Instead of allocating three PBOs and cycling through them, we allocate one PBO that's three times as large, and cycle through the subregion offsets. This results in arguably simpler code and faster initialization performance. Especially for 4K textures, initializing PBOs can take quite some time (e.g. 180ms -> 110ms). For 1080p, it's more like 66ms -> 52ms for me. The alignment to 4096 is completely unnecessary by spec, but we do it anyway just for peace of mind.
* img_format: fix a commentwm42017-07-151-3/+2
| | | | | This was changed a while ago. Part of it might still apply to the old D3D hwaccel glue code, though.
* vo_opengl: generalize --scale-clamp etc.Niklas Haas2017-07-126-11/+18
| | | | | This can help fight ringing without completely killing it, thus providing a middle-ground between ringing and aliasing.
* vo_opengl: remove redundant gl_video_setup_hooks callNiklas Haas2017-07-121-1/+0
| | | | | | | | This is unnecessary to call from gl_video_resize, because the hooks only (possibly) change when the actual vo_opengl options change. This used to be required back when mpv still had prescaling built in, but since that was all moved to user shaders and the code removed, this is a left-over artifact.
* player: change default section when loading encoding-profiles.confwm42017-07-122-5/+9
| | | | | | | It used to use the "encoding" section. Change this to the default section to remove another small special case. encoding-profiles.conf didn't use this by default anyway. The previous revert could mitigate potential impacts of this a little.
* Revert "player: always load encoding-profiles.conf"wm42017-07-121-3/+3
| | | | | | | | | | This reverts commit 0dcb51c7fa2c676ec30f2bac216f904dfc4ffa6f. I randomly decided that this was better. It can be re-applied once it actually becomes necessary in some way. Note that this worked fine. My main gripe with this is that it can spam the log file with encoding stuff even if playback mode is used.
* man/options: fix a few broken options' examplesRicardo Constantino2017-07-121-16/+14
|
* ytdl_hook: actually load the script-optsRicardo Constantino2017-07-112-8/+10
| | | | | Also, comma-separated list doesn't actually work, even quote-surrounded. Switch to using | instead.
* ytdl_hook: add option to exclude URLs from being parsedRicardo Constantino2017-07-112-4/+50
| | | | | | | | | This is more of a niche usecase than --ytdl-format and --ytdl-raw-options, so a simple script option should be enough. Either create lua-settings/ytdl_hook.conf with 'exclude=example.com,sub.example.com' option or "--script-opts=ytdl_hook-exclude=example.com,sub.example.com"
* ytdl_hook: add times for ytdl and hook running on debug-levelRicardo Constantino2017-07-111-0/+3
| | | | Not really important, but still interesting to know.
* ao_wasapi: remove redundant / outdated commentKevin Mitchell2017-07-101-1/+0
| | | | | Where this was moved from, it made slightly more sense. Here what the comment is trying to say is already pretty obvious from the code.
* ao_waspi: use switch for handling fix_format errorsKevin Mitchell2017-07-101-5/+8
|
* ao_wasapi: don't repeat format negotiation on align hackKevin Mitchell2017-07-101-4/+7
| | | | | Even if it did return a different result, the bufferFrameCount from the align hack would be wrong anyway.
* ao_wasapi: fix leak on align hackKevin Mitchell2017-07-101-1/+1
|
* vo_opengl: fix type of glsl variable frameAman Gupta2017-07-111-1/+1
|
* vo_opengl: don't make assumptions about plane orderwm42017-07-101-9/+30
| | | | | | | | | | | | | | | | | | | The renderer code doesn't list a fixed set of supported formats, but supports anything that is described by AVPixFmtDescriptor and follows a number of constraints. Plane order is not included in those constraints. This means the planes could be in random order, rather than what the vo_opengl renderer happens to assume. For example, it assumes that the 4th plane is alpha, even though alpha could be on any plane. Likewise it assumes that plane 0 was always luma, and planes 2/3 chroma. (In earlier iterations of format support, this was guaranteed by MP_IMGFLAG_YUV_P, but this is not used anymore.) Explicitly set the plane semantics (enum plane_type) by the component descriptors and the used colorspace. The behavior should mostly not change, but it's less likely to break when FFmpeg adds new pixel formats.
* ad_spdif: minor cleanupswm42017-07-101-3/+5
| | | | | | | | Use avcodec_free_context() unstead of random other calls. Actually it was already used in the second case, but calling avcodec_close() is redundant. Don't crash if allocating a codec context fails.
* vo_opengl: hwdec_dxva2egl: probe whether ANGLE mapping workswm42017-07-101-0/+12
| | | | | | | With some newer ANGLE builds, mapping can fail with "Failed to create EGL surface" during playback. The reason is unknown, and it might just be an ANGLE bug. Probe whether it works at init time to avoid the problem.
* vd_lavc: fix crashes with old hwaccelswm42017-07-101-7/+5
| | | | | | | | | | | | | | Commit d5702d3b95 messed up the order of destruction of the elements: it destroyed the avctx before the hwaccel uninit, even though the hwaccel uninit could access avctx. This could happen with some old hwaccels only, such as D3D ones before the new libavcodec hwaccel API. Fix this by making use of the fact that avcodec_flush_buffers() will uninit the underlying hwaccel. Thus we can be sure avctx is not using any hwaccel objects anymore, and it's safe to uninit the hwaccel. Move the hwdec_dev dstruction code with it, because otherwise we would in theory potentially create some dangling pointers in avctx.
* vo_opengl: fix dumb_mode chroma transformation fixupNiklas Haas2017-07-101-2/+2
| | | | | | | | In commit 6eb0bbe this was changed from xs[n] to use gl_format.chroma_w indiscriminately, which broke chroma rendering when zooming/cropping. The solution is to only use chroma_w for chroma planes. Fixes #4592.
* audio/out: fix comment typoKevin Mitchell2017-07-091-1/+1
|
* misc/ring: fix comment typoKevin Mitchell2017-07-091-2/+2
|
* ao_wasapi: enable packed 24 bit outputKevin Mitchell2017-07-091-1/+1
|
* audio/out: correct copy length in ao_read_data_convertedKevin Mitchell2017-07-091-6/+7
| | | | | | | | | | | | | Previously, the entire convert_buffer was being copied to the desination without regard to the fact that it may be packed and therefore smaller. The allocated conversion buffer was also way to big bytes * (channels * samples) ** 2 instead of bytes * channels * samples
* ao_wasapi: reorder channels and samplerates to speed up searchKevin Mitchell2017-07-091-4/+4
| | | | | | | This shouldn't affect which are chosen, but it should speed up the search by putting more common configurations earlier so that a working sample format and sample rates can be found sooner obviating the need to search them for each iteration of the outer loops.
* ao_wasapi: minor cosmetic fixesKevin Mitchell2017-07-091-3/+3
|
* ao_wasapi: try correct initial formatKevin Mitchell2017-07-091-1/+4
| | | | | | | | | The loop to select the native wasapi_format for the incoming audio was not breaking correctly when it found the most desirable format. It therefore executed completely leaving the least desirable format (u8) as the choice. fixes #4582
* vo_opengl: describe the remainder passes after user shadersNiklas Haas2017-07-091-0/+1
| | | | | | | | | | | | On optional hook points, we store to a temp FBO and then read from it again to complete any operations that may still be left (e.g. sigmoidization after MAIN/LINEAR). In theory this mechanism should be reworked to avoid the temporary FBO until the next time we actually need one - and also skip redundant passes if we the next thing we need *is* a FBO - but both are those are tricky. Anyway, in the meantime, at least we can label the (semi-)redundant passes that get generated when using user shaders.
* manpage: add a description for --scaleNiklas Haas2017-07-091-0/+1
| | | | For some reason this wasn't actually documented.
* vo_opengl: support tone-mapping-param for `clip`Niklas Haas2017-07-072-1/+4
| | | | | | | This just indicates a fixed linear coefficient to multiply into the signal, similar to the old option --target-brightness (but the inverse thereof). Good for testing purposes, which is why I added it. (This also corresponds somewhat to what zimg does)
* audio: drop AF_FORMAT_S24wm42017-07-073-44/+2
| | | | | | | | | | | This is the last sample format that was only in mpv and not in FFmpeg (except the spdif special formats). It was a huge pain, even if the removed code in af_lavrresample is pretty small after all. Note that this drops S24 from the ao_coreaudio AOs too. I'm not sure about the impact, but I expect it doesn't matter. af_fmt_change_bytes() was unused as well, so remove that too.
* ao_pcm: drop AF_FORMAT_S24 usagewm42017-07-071-1/+0
| | | | | | | I'd actually be somewhat interested in supporting this, as it could help testing the S24 conversion code. But then again it's only a pain, there's no immediate need, and it would require new options to make ao_pcm.c select this output format at all.
* ao_oss: drop AF_FORMAT_S24 usagewm42017-07-071-7/+0
| | | | Can't test / don't care.
* ao_sndio: drop AF_FORMAT_S24 usagewm42017-07-071-3/+0
| | | | | | I can't test it, so I'm dropping it without replacement. If anyone is interested in readding support, it would be done like the ao_alsa.c change.
* ao_wasapi_utils: be slightly more clever when converting channel mapwm42017-07-071-0/+5
|
* ao_wasapi: drop use of AF_FORMAT_S24wm42017-07-073-117/+133
| | | | | | | | | | | Do conversion directly, using the infrastructure that was added before. This also rewrites part of format negotation, I guess. I couldn't test the format that was used for S24 - my hardware does not report support for it. So I commented it, as it could be buggy. Testing this with the wasapi_formats[] entry for 24/24 uncommented would be appreciated.
* ao_alsa: drop use of AF_FORMAT_S24wm42017-07-071-21/+56
| | | | | | | | | | | | | Instead of the infrastructure added in the previous commit to do the conversion within the AO. If this is used, and snd_pcm_status_get_avail() returns more frames than snd_pcm_write*() actually accepts, you will get some nice audio corruption. Also, this mutates the data passed via play(), which is rather fishy, but sort of doesn't matter for now. Surely this will cause unintended bugs and WTFs.
* audio/out: add helper code to do 24 bit conversion in AOwm42017-07-073-0/+129
| | | | | | | | | | | | | | | | | | | | | | | | | I plan to remove the S24 sample formats in mpv. It seems like we should still support this _somehow_ in AOs though. So the idea is to convert the data to more obscure representations (that would not be useful for filtering etc. anyway) within the AO. This commit adds helper to enable this. ao_convert_fmt is meant to provide mechanisms for this, rather than a generic audio format description (as the latter leads only to overly generic misery). The conversion also supports only cases which we think will be needed at all. The main advantage of this approach is that we get S24 out of sight, and that we could support other crazy formats (like S20). The main disadvantage is that usually S32 will be selected (if both S32 and S24 are available), and there's no user control to force S24. That doesn't really matter though, and at worst makes testing harder or will lead to unpleasant arguments with audiophiles (they'd be wrong anyway). ao_convert_fmt.pad_lsb is ignored, although if we ever find a case in which playing S32 with data in the LSBs breaks when playing it as padded 24 bit format. (For example, WAVEFORMATEXTENSIBLE recommends setting the unused bits to 0 if wValidBitsPerSample implies LSB padding.)
* vo_opengl: rework --opengl-dumb-modeNiklas Haas2017-07-073-8/+15
| | | | | | | It's now possible to request non-dumb mode as a user, even when not using any non-dumb features. This change is mostly intended for testing, so I can easily switch between dumb and non-dumb mode on default settings. The default behavior is unaffected.
* vo_opengl: correct off-by-one in scale=oversampleNiklas Haas2017-07-071-1/+1
| | | | This caused a single pixel shift to the top-left, introduced in e3e03d0f3.
* vo_opengl: do not use vaapi-over-GLXwm42017-07-073-5/+4
| | | | | | | | | | | | | | | This backend is selected if vaapi is available, but vaapi-over-EGL is not. This causes various issues around the forced RGB conversion, which is done with fixed, usually incorrect parameters. It seems the existing auto probing check is too weak, and doesn't really prevent it from getting loaded. Fix this by adding a flag to not ever load this during auto probing. I'm still not deleting it, because it's useful for testing on nvidia machines. See #4555.
* vo_opengl: prevent desat from blowing up for negativeNiklas Haas2017-07-071-1/+1
| | | | | | | The current algorithm blew up when the color was negative, such as the case when downscaling with dscale=mitchell or other algorithms that introduce negative ringing. The simplest solution is to just slightly change the calculation to force both parameters to be in-range.
* demux_lavf: remove --demuxer-lavf-cryptokey optionwm42017-07-063-9/+2
| | | | | | | | Was at least somewhat broken, and is misleading. I don't really have an idea why FFmpeg has two AVOptions here anyway. We don't need to care, and I'm only aware of 1 user trying this option ever. See #4579.
* js: utils.getenv(): fix crash on undefined varAvi Halachmi (:avih)2017-07-062-2/+8
|
* options/path: fallback to USERPROFILE if HOME isn't setRicardo Constantino2017-07-061-1/+4
| | | | | | | HOME isn't set by default on Windows. But if the user does set it, prefer it by default. Enables stuff like --log-file=~/mpv.log to work, even if HOME isn't set.
* demux_lavf: potentially fix --demuxer-lavf-cryptokeywm42017-07-061-21/+3
| | | | | | | | | | | | The first time I saw a user try to use this option, and apparently it didn't work. I'm not exactly sure why, but the code seems to be broken anyway. Apart from not doing any error checking (neither mallocs nor warning the user against invalid input), it forgets to add a 0 terminator. Use the corresponding AVOption instead, which probably works. See #4579.
* ad_lavc, vd_lavc, sd_lavc: consistently use avcodec_free_context()wm42017-07-063-15/+3
| | | | | Instead of various ad-hoc ways to achieve the same thing. (The API was added only later.)
* vo_opengl: also expose NAME_mul for user shadersNiklas Haas2017-07-062-2/+11
| | | | | | | | | This is exposed so that bjin/mpv-prescalers can use textureGatherOffset for performance. Since there are now quite a lot of parameters where it isn't quite clear why they're all defined, add a paragraph to the man page that explains them a bit.
* vo_opengl: prevent division by zero in shaderNiklas Haas2017-07-061-1/+1
| | | | | In theory the max() should clamp it away anyway but I believe division by zero is UB so just avoid it altogether.
* vo_opengl: add --tone-mapping-desaturateNiklas Haas2017-07-065-6/+29
| | | | | | | This helps prevent unnaturally, weirdly colorized blown out highlights for direct images of the sunlit sky and other way-too-bright HDR content. I was debating whether to set the default at 1.0 or 2.0, but went with the more conservative option that preserves more detail/color.
* vo_opengl: get rid of weird double-bind in pass_read_fboNiklas Haas2017-07-051-4/+2
| | | | | | | | This logic doesn't really make sense. copy_img_tex already binds the texture, so why would we bind it a second time? Furthermore, nothing actually uses this return value. Must have been some left-over artifact of a previous iteration of this function. Anyway, it's harmless, just nonsensical. So remove it.
* vo_opengl: remove redundant left-over lineNiklas Haas2017-07-051-1/+0
| | | | The pass_read_fbo immediately below replaces it
* vo_opengl: use textureGatherOffset for polar filtersNiklas Haas2017-07-056-45/+91
| | | | | | | | | |