summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ao_lavc: use new sample format determination codewm42015-09-103-24/+16
| | | | | | | This is just a refactor, which makes it use the previously introduced function, and allows us to make af_format_conversion_score() private. (We drop 2 unlikely warning messages too... who cares.)
* audio/format: add function for determining sample conversion candidateswm42015-09-102-0/+32
|
* audio/format: fix interlaved vs. non-interleaved conversionswm42015-09-101-1/+1
| | | | | | | | | | This mixed up the returned score for some interleaved/non-interleaved comparisons. Changing interleaving subtracted 1 point, while extending sample size by 1 byte also subtracted 1 point. (This scoring system is not ideal - it'd be much cleaner to do a 3-way sample format comparison instead, and sort the formats according to the comparison instead of the score.)
* audio/format: actually prefer float over double sample formatwm42015-09-101-1/+1
| | | | | ...for int->float conversions. This code accidentally inverted the condition.
* video: do not use deprecated libavutil pixdesc fieldswm42015-09-103-5/+27
| | | | | | These were normalized and are saner now. We want to use the new fields, and also get rid of the deprecation warnings, so use them. There's no release yet which uses these, so some ifdeffery is unfortunately needed.
* vo_opengl: fix shader compilation with debanding and OSX hwdecwm42015-09-103-8/+10
| | | | | | 2 things are being stupid here: Apple for requiring rectangle textures with their IOSurface interop for no reason, and OpenGL having a different sampler type for rectangle textures.
* vo_opengl: move sampler type mapping to a functionwm42015-09-102-7/+14
|
* command: make "add <property> 0" not change the valuewm42015-09-103-5/+10
| | | | | | | | | | | | | | | The value 0 was treated specially, and effectively forced the increment to 1. Interestingly, passing 0 or no value also does not include the scale (from touchpads etc.), but this is probably an accidental behavior that was never intentionally added. Simplify it and make the default increment 1. 0 now means what it should: the value will not be changed. This is not particularly useful, but on the other hand there is no need for surprising and unintuitive semantics. OARG_CYCLEDIR() failed to apply the default value, because m_option_type_cycle_dir was missing a copy handler - add this too.
* cache: do not include backbuffer size in total stream cache sizewm42015-09-102-2/+4
| | | | | | | | | This causes weirdness with the "cache-size" property and option. Only the read handler of the property included the backbuffer, while all others did not. Make it consistent, and subtract the backbuffer size from the cache size. Fixes #2305.
* DOCS: cleanup API changes version markerswm42015-09-102-10/+11
| | | | | | Make it so that they don't need to be edited on release (no change in tense). Also, move the "stray" changes after client API version 1.19 to 1.19 itself.
* vo_opengl: fix deband sub-option handlingwm42015-09-091-1/+6
| | | | This all has to be done manually.
* vo_opengl: implement debanding (and remove source-shader)Niklas Haas2015-09-097-98/+228
| | | | | | | | | | The removal of source-shader is a side effect, since this effectively replaces it - and the video-reading code has been significantly restructured to make more sense and be more readable. This means users no longer have to constantly download and maintain a separate deband.glsl installation alongside mpv, which was the only real use case for source-shader that we found either way.
* old-makefile: update for recent OpenGL refactorswm42015-09-091-9/+14
|
* vo_opengl: move self-contained shader routines to a separate fileNiklas Haas2015-09-095-348/+425
| | | | | | | | | | | This is mostly to cut down somewhat on the amount of code bloat in video.c by moving out helper functions (including scaler kernels and color management routines) to a separate file. It would certainly be possible to move out more functions (eg. dithering or CMS code) with some extra effort/refactoring, but this is a start. Signed-off-by: wm4 <wm4@nowhere>
* vo_opengl: reduce code duplication for scaler optionsNiklas Haas2015-09-091-33/+16
| | | | | This simple refactor cuts down on the immense amount of overhead and duplication across all of the related scale-* options.
* vo_opengl: remove gl_ prefixes from files in video/out/openglNiklas Haas2015-09-0927-56/+56
| | | | | This is a bit redundant with the name of the directory itself, and not in line with existing naming conventions.
* vo_opengl: move gl_* files to their own subdirNiklas Haas2015-09-0927-40/+40
| | | | | This is mainly just to keep things a bit more organized and separated inside the codebase.
* vo_opengl: minor refactorNiklas Haas2015-09-091-5/+5
| | | | | Just making the argument order for pass_load_fbotex more consistent with finish_pass_fbo.
* Use setfield, not --field-dominance. See #2297.Rudolf Polzer2015-09-091-6/+6
|
* vo_opengl: filter allowed options in dumb-modewm42015-09-081-14/+14
| | | | | | | Instead of the other way around of disabling disallowed options. This is more robust and also slightly simpler, at least conceptually. If new vo_opengl features are added, they don't need to be explicitly disabled for dumb-mode just to avoid that it accidentally breaks.
* vo_opengl: move gl_video_opts copying code to separate functionwm42015-09-082-15/+22
| | | | | | | | | | Sigh... Hopefully this code will be completely unnecessary one day, as it's only needed due to the sub-option parser craziness. Move dumb_mode to the top of the struct, so the C universal initializer doesn't cause warnings with all those broken compilers.
* af_lavrresample: remove unnecessary indirectionswm42015-09-081-35/+30
| | | | | | | Not sure why struct af_resample_opts even exists. It seems useful to group the fields set by user options. But storing the current format conversion parameters doesn't seem very elegant, and having a separate instance in the "ctx" field isn't helpful either.
* af_lavrresample: add normalize suboptionwm42015-09-082-1/+13
|
* vo_opengl: restore single pass optimization as separate code pathwm42015-09-073-31/+92
| | | | | | | | | | | | | | | | | | | | | | The single path optimization, rendering the video in one shader pass and without FBO indirections, was removed soem commits ago. It didn't have a place in this code, and caused considerable complexity and maintenance issues. On the other hand, it still has some worth, such as for use with extremely crappy hardware (GLES only or OpenGL 2.1 without FBO extension). Ideally, these use cases would be handled by a separate VO (say, vo_gles). While cleaner, this would still cause code duplication and other complexity. The third option is making the single-pass optimization a completely separate code path, with most vo_opengl features disabled. While this does duplicate some functionality (such as "unpacking" the video data from textures), it's also relatively unintrusive, and the high quality code path doesn't need to take it into account at all. On another positive node, this "dumb-mode" could be forced in other cases where OpenGL 2.1 is not enough, and where we don't want to care about versions this old.
* vo_opengl: move video source rectangle computation to a functionwm42015-09-071-18/+29
| | | | Needed for the following commit.
* vo_opengl: comsetics: remove unnecessary line breakwm42015-09-071-4/+2
|
* vo_opengl: require FBOs and get rid of the single-pass optimizationNiklas Haas2015-09-072-91/+42
| | | | | | | This change makes vo_opengl slightly less compatible (ancient devices without FBOs will no longer work) and decreases performance in the simplest case (vo=opengl), in exchange for significantly reducing code complexity and making everything easier to reason about.
* osd: delay libass initialization as far as possiblewm42015-09-072-5/+11
| | | | | | | | | | | | Until now, most OSD objects created the associated ASS_Renderer instance as soon as possible, even if nothing was going to be rendered. Maybe this was even intentional. Change this for the sake of lowering resource usage, and strictly initialize ASS_Renderer only when it's really needed. For the OSC, initialization has to be forced, because of the insane mechanism for translating mouse coordinates to OSD coordinates.
* options: fix --no-configwm42015-09-054-5/+5
| | | | | | | | | | | | | | | | | | This was completely broken. It was checked manually in some config loading paths, so it appeared to work. But the intention was always to completely disable reading from the normal config dir. This logic was broken in commit 2263f37d. The manual checks are actually redundant, and are not needed if --no-config is implemented properly - remove them. Additionally, the change to load the libmpv defaults from an embedded profile also failed to set "config=no". The option is marked as not being settable by a config file, and the libmpv default profile is parsed as a config file, so this option was rejected. Fix it by removing the CONF_NOCFG flag. (Alternatively, m_config_set_profile() could be changed not to set the "config file" flag by default, but I'm not bothering with this.)
* DOCS/client_api_examples/sdl: make the window resizablewm42015-09-041-1/+2
|
* af_lavrresample: add missing include statementwm42015-09-041-0/+1
| | | | | | Apparently, this broke compilation with Libav under some circumstances. Looking at it again, it shouldn't have, but this change doesn't hurt anyway.
* vo_opengl: use the correct attribute name for vertex positionwm42015-09-041-2/+2
| | | | | | This didn't seem entirely sane. It probably worked by accident, because "position" is always the first attribute, and thus the default value 0 for the location was always correct.
* audio/filter: remove af_bs2b toowm42015-09-047-202/+0
| | | | | | | Some users still use this filter, so the filter was going to be kept. But I overlooked that libavfilter provides this filter. Remove the redundant wrapper from mpv. Something like --af=lavfi=bs2b should work and give exactly the same results.
* audio/filter: remove some useless filterswm42015-09-0324-4132/+0
| | | | | | | | | | | | | | | | | | | | | | | | All of these filters are considered not useful anymore by us. Some have replacements in libavfilter (useable through af_lavfi). af_center, af_extrastereo, af_karaoke, af_sinesuppress, af_sub, af_surround, af_sweep: pretty simple and useless filters which probably nobody ever wants. af_ladspa: has a replacement in libavfilter. af_hrtf: the algorithm doesn't work properly on most sources, and the implementation was buggy and complicated. (The filter was inherited from MPlayer; but even in mpv times we had to apply fixes that fixed major issues with added noise.) There is a ladspa filter if you still want to use it. af_export: I'm not even sure what this is supposed to do. Possibly it was meant for GUIs rendering audio visualizations, but it couldn't really work well. For example, the size of the audio depended on the samplerate (fixed number of samples only), and it couldn't retrieve the complete audio, only fragments. If this is really needed for GUIs, mpv should add native visualization, or a proper API for it.
* player: log error code on playback exitwm42015-09-031-0/+2
| | | | So far, this required using the client API to know it.
* ebml: warn if an EBML has unknown lengthwm42015-09-031-0/+4
| | | | | | | | | | | | | While unknown lengths are supported in some important cases like segments and clusters, they are not for small and complex metadata elements like the track list. Such elements are simply rejected. This case was caught by the size sanity check below, but the message is misleading and wrong. (There are likely no files in the wild which require support for this. The sample file I've seen was muxed by libavformat, but in a case where it aborted when writing the header. Clearly a broken file.)
* manpage: fix typowm42015-09-031-1/+1
| | | | Fixes #2279.
* vd_lavc: better hwdec log outputwm42015-09-022-4/+17
| | | | | | | | | | | | Often, we don't know whether hardware decoding will work until we've tried. (This used to be different, but API changes and improvements in libavcodec led to this situation.) We will often output that we're going to use hardware decoding, and then print a fallback warning. Instead, print the status once we have decoded a frame. Some of the old messages are turned into verbose messages, which should be helpful for debugging. Also add some new ones.
* vd_lavc: factor all hwdec fallbacks into the same functionwm42015-09-021-24/+19
| | | | | | | | The fallback at initialization time was basically duplicated, maybe for the sake of showing a different error message. This doesn't matter anymore; not much can fail at initialization anymore. Most meaningful and common errors happen either at probing or in get_format (when the actual hw decoder is initialized).
* vo_opengl: improve robustness against PBO failurewm42015-09-021-29/+40
| | | | | | | | | | | | | | If PBO upload fails, disable PBOs and revert to the normal codepath. In theory we should retry PBO upload on failure (because OpenGL specifies that it can sporadically fail), but since it normally doesn't happen, and the fallback will work, I'm not bothering. Some restructuring is needed, since glUnmapBuffer needs to be called earlier. In fact, the old code structure didn't make too much sense, and is a leftover from MPlayer's direct rendering support, which let the decoder decode to a PBO-mapped region. This means the buffer_ptr field can be dropped. Drop buffer_size as well, since it only had 2 possible values (0 or the size required for the current config).
* vo_opengl: enable pbo by default with opengl-hqwm42015-09-022-1/+2
| | | | | | | | | Can significantly help with very large video resolutions on nvidia drivers. It doesn't seem to have negative effects on Intel drivers either. (Although it could have on Intel drivers for older hardware.) For now, this is only for --vo=opengl-hq. Maybe --vo=opengl should use it too, but it's still meant to be the crappy, fail-safe default.
* vo_opengl: slightly simplify plane size determinationwm42015-09-021-2/+5
| | | | | | | | Setup a dummy image for the given image params, and get the plane sizes from that. Admittedly not much of a simplification, but conceptually it's simpler and less error-prone, as the image layout is guaranteed to be the same, rather than essentially duplicating the way it is determined.
* vo_opengl: don't distinguish "real" and texture sizewm42015-09-023-34/+28
| | | | | | | | This is from times when we supported padded/non-NPOT textures. The difference is not useful anymore, and theoretical support for different sizes is most likely buggy and unmaintained. So remove it. Also remove the tex_ prefix wherever it appears.
* vo_opengl: simplify PBO copywm42015-09-021-6/+2
| | | | | | | | Use mp_image_copy() instead of copying manually. (This function checks whether the destination is regarded writeable, which it is not, because the destination is the source image with changed pointers, so refcounting has to be removed from the destination image by resetting mpi->bufs.)
* vo_opengl: rename get_image to map_imagewm42015-09-021-2/+2
|
* vo_opengl: remove redundant statement in PBO codewm42015-09-022-5/+0
| | | | | | | | This shouldn't be needed anymore. Textures are now always allocated with the exact size. Any padding (including non-NPOT support) is gone. The texture sizes will always match the memory plane sizes. Drop the unused and forgotten "npot" field from the option struct too.
* screenshot: avoid confusing template error message with no fileKevin Mitchell2015-09-021-9/+11
| | | | | | | Previously, with mpv --force-window=yes --idle=yes --screenshot-template="%f", mpv would display an error saying that the template was incorrect, which it isn't, there's just no file to put in the format. In this case, just use the string "NO_FILE".
* sub: always try to use libavcodec text subtitle converterwm42015-09-011-12/+4
| | | | | | | | | | | | Drop the whitelist. It's annoying to maintain. Instead, accept any subtitle decoder. Since this code path will now also be taken by bitmap subtitle decoders not whitelisted by sd_lavc.c, add a warning when bitmap subtitles are decoded. (To reduce or increase potential user confusion.) To some degree, a whitelist is needed to distinguish text and bitmap subtitles. FFmpeg has an API to distinguish them in a generic way to some degree, but Libav doesn't. So we just stick with this for now.
* vo_opengl: remove some leftoverswm42015-09-011-4/+0
| | | | Forgotten in the previous commit.
* vo_opengl, vda: return to old statewm42015-09-012-31/+5
| | | | | | | | Undo 292266f2. Reapply 3e12e79b. An additional copy is not really justified, as it could reduce performance. On the other hand, we can force API users to create a GL 3.x context.
* sub: fix --sub-codepage UTF-8 with fallbackwm42015-09-011-0/+4
| | | | | | | | Fixes e.g --sub-codepage=utf8:gb18030 if the subtitle us UTF-8. This was broken in commit e5d31808. Also log the detected charset in verbose mode.
* vo_rpi, vo_opengl: do not globally terminate EGL on VO uninitwm42015-08-311-2/+1
| | | | | | | | | eglTerminate() affects the EGLDisplay in all threads. Since the RPI firmware apparently only ever uses EGL_DEFAULT_DISPLAY, this means it will trash all other contexts on other threads in the same process. Thus we don't call eglTerminate() at all, at least on RPI. Call eglReleaseThread() instead (which may or may not be a NOP).
* vo_opengl: fix alpha video in one casewm42015-08-301-0/+2
| | | | | | | | | yuva444p worked, yuva420p didn't. This happened because the chroma pass discards the alpha plane, which is referenced by the alpha blend code later. Add a terrible hack to work this around, actually using the same hack as was used for the Y plane. (A terrible hack for terrible code.)
* video: make container vs. bitstream aspect ratio configurablewm42015-08-307-18/+59
| | | | | | Utterly idiotic bullshit. Fixes #2259.
* w32: shift drag and drop appendsKevin Mitchell2015-08-301-2/+4
| | | | use the append to playlist functionality if shift is pressed while dropping
* x11: drag and drop append with modifierKevin Mitchell2015-08-302-1/+8
| | | | | | | If the drag and drop action is anything other than XdndActionCopy, append the dropped files rather than replacing the existing playlist. With most file managers, this will mean at least pressing shift while dropping.
* input: add append argument to file drop eventKevin Mitchell2015-08-306-12/+21
| | | | | | This puts in place the machinery to merely append dropped file to the playlist instead of replacing the existing playlist. In this commit, all front-ends set this to false preserving the existing behaviour.
* osc: reinit on playlist changesKevin Mitchell2015-08-291-0/+1
| | | | | | This takes care of the corner case where the player is started with a single playlist entry so that the next/prev arrows are greyed out, but remain that way even after new elements are added to the playlist.
* player: slightly better error reporting when opening file failswm42015-08-281-2/+7
| | | | Return MPV_ERROR_LOADING_FAILED instead of MPV_ERROR_NOTHING_TO_PLAY.
* client API: improve an error messagewm42015-08-281-1/+1
| | | | | This refers to media played by mpv, and these don't necessarily have to be files. They can be network resources or entirely abstract URLs too.
* osc: exit tick immediately if disabled.torque2015-08-281-0/+2
| | | | | | | | | | | Even after it has been disabled with the `disable-osc` message, the OSC continues to run the tick function. Completely preventing tick from being called is impractical since there are several different places that it's called in the code, so just make it immediately return if the OSC has been disabled. This prevents the OSC from continuing the clear the OSD on every tick, allowing other scripts to disable it so that they may draw to the OSD.
* sd_ass: assume negative durations are unknown durations, and handle themwm42015-08-271-5/+27
| | | | | | | | | | | | | | | The FFmpeg can officially not distinguish between unknown subtitle durations, and subtitle durations being 0. (It documents the value 0 meaning unknown duration.) In practice, at least the LRC demuxer signals unknown subtitle durations with a negative value. Assume negative durations mean unknown duration. Show subtitles with unknown duration forever. Unless there's a subtitle event following it; then reset the duration so that it ends on the new subtitle event. Fixes #2244.
* ytdl: catch bogous extractor infoChrisK22015-08-271-12/+12
| | | | | | | Some extractors may claim to have extracted subtitles, but then set the relevant fields to null. Try to catch those cases. Fixes #2254
* demux_mkv: discard broken indexwm42015-08-26