summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* options: remove options-to-property bridgewm42019-11-256-85/+6
| | | | | | | | The previous bunch of commits made this unnecessary, so this should be a purely internal change with no user impact. This may or may not open the way to future improvements. Even if not, at least the property/option interaction should now be much less buggy.
* command: shuffle around even more crapwm42019-11-252-79/+23
| | | | | | | | | | | | | | | | | | Convert some remaining properties to work without the option-to-property bridge. Behavior shouldn't change (except for the corner case that it tries to reapply the new state when setting a property, while it used to ignore redundant sets). As it is the case with many of these changes, much of the code is not in its final proper state yet, but is rather a temporary workaround. For example, these "VO flag" properties should just be fully handled in the VO backend. (Currently, the config or VO layers don't provide enough mechanism yet as that all the backends like x11, win32, etc. could be changed yet, but that's another refactoring mess for another time.) Now nothing relies on this option-to-property bridge anymore, which opens the way to even more refactoring, which eventually may result in tiny improvements for the end user.
* command: change vid/aid/sid property behavior slightlywm42019-11-253-48/+35
| | | | | Again in line with the option-to-property bridge changes. As usual, this causes subtle behavior changes, which may affect some users.
* options: pre-check filter names when using vf/af libavfilter bridgewm42019-11-255-1/+29
| | | | | | | | | | | | | Until now, using a filter not in mpv's builtin filter list would assume it's a libavfilter filter. If it wasn't, the option value was still accepted, but creating the filter simply failed. But since this happens after option parsing, so the result is confusing. Improve this slightly by checking filter names. This will reject truly unknown filters at option parsing time. Unfortunately, this still does not check filter arguments. This would be much more complex, because you'd have to create a dummy filter graph and allocate the filter. Maybe another time.
* command: change af/vf property behavior wrt. filter creation failureswm42019-11-253-12/+19
| | | | | | The behavior is slightly different in a messy way. The change is in line with the option-to-property bridge removal mentioned some commits ago and thus is deemed necessary.
* command: remove redundant reinit_filters() call on filter change failurewm42019-11-251-1/+0
| | | | | | This attempted to restore the old filter chain if setting a new one at runtime failed. This is not needed anymore, because changing the filter chain is done in a "transactional" way now.
* f_output_chain: fix possible crash when changing filterswm42019-11-251-2/+4
| | | | | | When changing filters at runtime (vf/af commands/properties), this could crash due to a NULL pointer access. The code for comparing the old and new option values (to detect changes) was simply buggy.
* m_config: discourage mp_read_option_raw()wm42019-11-251-0/+1
| | | | | | This function is dangerous, because it disables the already basic/week type checking the option system has at all. I'm tend towards thinking that all of its uses should be replaced.
* command, options: deprecate old --display-fps behaviorwm42019-11-255-9/+40
| | | | | | | See changelog and manpage changes. (So much effort to fix an ancient dumb mistake for an option nobody should use anyway.)
* command: shuffle some crap aroundwm42019-11-256-170/+109
| | | | | | | | | | | | | | | | | | | | | | | | This is preparation to get rid of the option-to-property bridge (mp_on_set_option). This is a pretty insane thing that redirects accesses to options to properties. It was needed in the ever ongoing transition from something to... something else. A good example for the need of this bridge is applying profiles at runtime. This obviously goes through the config parser, but should also make all changes effective, for which traditionally the property layer is used. There isn't much left that needs this bridge. This commit changes a bunch of options (which also have a property implementation) to use option change notifications instead. Many of the properties are still left, but perform unrelated functions like OSD formatting. This should be mostly compatible. There may be some subtle behavior changes. For example, "hwdec" and "record-file" do not check for changes anymore before applying them, so writing the current value to them suddenly does something, while it was ignored before. DVB changes untested, but should work.
* manpage: remove audio-file etc. caveat descriptionwm42019-11-241-13/+0
| | | | | | | These properties actually were removed/replaced, so there is no conflict with the options of the same name anymore. For example, there is no "audio-file" property anymore, but you still can set "audio-files" (and --audio-file simply maps to --audio-files-append).
* options: remove deprecated --playlist-pos aliaswm42019-11-243-5/+1
| | | | | This causes problems because it has the same name as a property which behaves differently.
* input: use array instead of linked list for sectionswm42019-11-231-26/+26
| | | | Shouldn't change behavior.
* lua: make add_key_binding() rotate optional arguments correctlywm42019-11-232-2/+8
| | | | | | | | add_key_binding() makes the name argument optional (in weird Lua fashion), which did not work if there were additional arguments. So there is no way to avoid specifying a name while passing a rp argument. Fix this, declare this way of skipping the argument as deprecated, and allow passing name=nil as the preferred way to skip the name argument.
* input: remove potential minor memory leakwm42019-11-231-0/+1
|
* vo_gpu: fix infinite scaler reinit spamNiklas Haas2019-11-231-8/+9
| | | | | | | | | Handling the window with this function makes no sense, since windows and kernels are not the same thing and don't share the same option list. The only reason it's done is to make sure the char* points at the static string rather than the dynamically allocated one, which we can do manually in this function. Rewrite a bit for clarity/quality.
* input: export input.conf comments ot input-bindings propertywm42019-11-234-7/+34
| | | | | | | | | | | | | | This is supposed to turn input.conf comments into inline documentation. Whether this will be useful depends on whether there'll be a script using this field. This changes a small aspect of input.conf parsing fundamentally: this attempts to strip comments/whitespace from the command string, which will later be used to generate the command when a key binding is executed. This should not have any negative effects, but there could be unknown bugs. (For some reason, every command is parsed when input.conf is parsed, but it still only stores the string for the command. I guess that saves some minor amount of memory.)
* command, input: add input-bindings propertywm42019-11-234-1/+105
| | | | | | Read-only information about all bindings. Somewhat hoping someone can make a nice GUI-like overlay thing for it, which provides information about mapped keys.
* command: add command-list propertywm42019-11-232-0/+33
|
* input: change mp_cmd.original from bstr to cstrwm42019-11-234-8/+9
| | | | | | | | No reason to have this as bstr, just makes everything more complex. Also clear mp_cmd.sender when it's copied. Otherwise it would be a dangling pointer. Apparently it's never set to non-NULL in this situation, but this is cleaner anyway.
* demux_lavf: log packet read errorsAman Gupta2019-11-221-1/+1
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* input: make MP_INPUT_RELEASE_ALL a pseudo-keywm42019-11-222-3/+2
| | | | | | | Should be without consequences. I think this is less trouble, because code frequently wants to add/remove bits for modifiers and key state from key codes, and with this change you can't accidentally break it by testing or removing bits from the old -1 value.
* msg: show how many messages were droppedwm42019-11-221-1/+3
| | | | Although repl.lua will probably not use this.
* msg: drop old instead of new messages on overflowwm42019-11-221-43/+57
| | | | | | | | | | | | It did that because there was no other way. It used a lock-free ring buffer, which does not support this. Use a "manual" ring buffer with explicit locks instead, and drop messages from the start. (We could have continued to use mp_ring, but it was already too late, and although mp_ring is fine, using it for types other than bytes looked awkward, and writing a ring buffer yet again seemed nicer. At least it's not C++, where mp_ring would have been a template, and everything would have looked like shit soup no matter what.)
* msg: fix missing wakeup callback in terminal-default log levelwm42019-11-221-0/+2
| | | | | | | | | In the referenced commit, I forgot about this part, and a client which tried to use this was actually not woken up when needed. (Also why the hell does the subject line of that commit say "removed"?) Fixes: 8c2d73f11205
* input: add text produced by key to script key eventswm42019-11-227-7/+32
| | | | | | | Particularly for "any_unicode" mappings, so they don't have to special-case keys like '#' and ' ', which are normally mapped to symbolic names for input.conf reasons. (Though admittedly, this is a pretty minor thing, since API users could map these manually.)
* manpage: correct "complex" key binding descriptionwm42019-11-221-2/+2
| | | | | | | The key is never nil if it's invoked through the normal input path. The key name could be "" if mp_cmd.key_name==NULL. This should not happen, but there's no strong guarantee in input.c that it cannot happen, so whatever.
* manpage: improve "complex" key binding list of table entrieswm42019-11-221-6/+13
|
* input: introduce a pseudo key name that grabs all text inputwm42019-11-224-4/+19
| | | | | | | | | The intended target for this is the mpv.repl script, which manually added every single ASCII key as a separate key binding. This provides a simpler mechanism, that will catch any kind of text input. Due to its special nature, explicitly do not give a guarantee for compatibility; thus the warning in input.rst.
* input: fix ineffective mp_msg_test callwm42019-11-221-1/+1
| | | | | | This was supposed not to go through key lookup if the message wasn't going to be output, but for whatever reason the log levels were mismatched.
* js: complex key binding: use key_name like the docs sayAvi Halachmi (:avih)2019-11-201-1/+1
|
* js: report key name for "complex" key bindings - match b08c8f50Avi Halachmi (:avih)2019-11-201-4/+5
|
* lua: complex key binding: use key_name like the docs sayAvi Halachmi (:avih)2019-11-201-1/+1
|
* player: Optionally validate st_mtime when restoring playback stateChris Down2019-11-206-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I often watch sporting events. On many occasions I get files with the same filename for each session. For example, for F1 I might have the following directory structure: F1/ FP1.mkv FP2.mkv FP3.mkv Qualification.mkv Race.mkv Since usually one simply watches one race after the other, I usually just rsync the new event's files over the old ones, so, for example, Race.mkv will be replaced from the file for the last event with the file from the new event. One problem with this is that I like to use --resume-playback for other kinds of media, so I have it on by default. That works great for, say, a movie, but doesn't work so well with this scheme, because you can trivially forget to pass --no-resume-playback on the command line and end up 2 hours in, watching spoilers as the race results scroll down the screen :-) This patch adds a new option, --resume-playback-check-mtime, which validates that the file's mtime hasn't changed since the watch_later configuration was saved. It does this by setting the watch_later configuration to have the same mtime as the file after it is saved. Switching back and forth between checking mtime and not checking mtime works fine, as we only choose whether to compare based on it, but we update the watch_later configuration mtime regardless of its value.
* manpage: extend documentation of key nameswm42019-11-191-0/+74
| | | | These things weren't written down anywhere yet.
* lua: report key name for "complex" key bindingswm42019-11-192-7/+9
| | | | This might make certain use cases less of a mess.
* manpage: deprecate input section commandswm42019-11-192-0/+8
| | | | | | | | | | These were a bad idea and are obscure. Scripting key mapping support still uses them, but this is not relevant to scripting authors, because the mpv provided helper code (defaults.lua) takes care of this. In addition, the OSC uses a legacy form of this. Hopefully, this input section stuff can be removed, and replaced by a simpler mechanism.
* audio: add ao_audiotrack for androidAman Gupta2019-11-193-0/+722
|
* misc: add jni helpersAman Gupta2019-11-193-0/+591
|
* audio: fix minor whitespace issue in out/internal.hAman Gupta2019-11-191-1/+1
|
* js: don't pre-filter log level argument in mp.enable_messages()Avi Halachmi (:avih)2019-11-191-2/+3
| | | | Match lua's 8e5642ff
* DOCS/contribute.md: some clarificationswm42019-11-181-3/+7
| | | | Even if nobody ever reads this file.
* video/out/bitmap_packer: Avoid empty initializer listMichael Forney2019-11-181-1/+1
|
* video/out/vo_tct: Use octal escape sequence instead of non-standard \eMichael Forney2019-11-181-9/+9
|
* video/out/gpu: Remove stray top-level ';'Michael Forney2019-11-182-2/+2
|
* player: remove mechanisms for better logging with repl.luawm42019-11-185-8/+87
| | | | | | | | | | | | | | | | | | | | | | As preparation for making repl.lua part of the core (maybe), add some mechanisms which are supposed to improve its behavior. Add a silent mode. Calling mpv_request_log_messages() with the log level name prefixed with "silent:" will disable logging from the API user's perspective. But it will keep the log buffer, and record new messages, without returning them to the user. If logging is enabled again by requesting the same log level without "silent:" prefix, the buffered log messages are returned to the user at once. This is not documented, because it's far too messy and special as that I'd want anyone to rely on this behavior, but it will be perfectly fine for an internal script. Another thing is that we record early startup messages. The goal is to make the repl.lua script show option and config parsing file errors. This works only with the special "terminal-default" log level. In addition, reduce the "terminal-default" capacity to only 100 log messages. If this is going to be enabled by default, it shouldn't use too much resources.
* lua: don't pre-filter log level argument in mp.enable_messages()wm42019-11-181-2/+4
| | | | | | | | | | | | This will just make it not work if mpv_request_log_messages() gets extended to accept more names. Pass the argument without checking. To keep the behavior the same (for whatever reasons, probably not important), still raise an error if the libmpv API function returns an error that the argument was bad. (The check_loglevel() function is still used when the script _emits_ log messages, which is different, and for which there is no API anyway.)
* vo_gpu: hwdec_cuda: Reduce message level of errors while probingPhilip Langdale2019-11-172-5/+7
| | | | | | We should only be printing errors that occur when not probing, to avoid creating the impression that something is wrong - and errors during probing isn't a problem.
* options: deprecate --video-sync=display-adropwm42019-11-173-0/+9
| | | | A stupid thing that will probably be in the way.
* player: remove some unnecessary coverart special caseswm42019-11-173-4/+2
| | | | | | | | These should not be needed, since video is in EOF mode in this case anyway. Not too sure about the video.c case to be honest, well, here goes nothing.
* video: make track switching work for external imageswm42019-11-171-7/+13
| | | | | | | | Until now, this didn't work, since the external image had pts 0; so enabling video at a later time did nothing, because the image was discarded. Since hrseek now ends on the last frame (instead of nothing), reusing the hrseek mechanism solves this, and we don't even need to treat the cursed coverart case separately.
* player: remove commented declarationwm42019-11-171-1/+0
| | | | It was commented almost 2 years ago in a "rewrite everything" commit.
* audio: log A/V initial sync statuswm42019-11-171-0/+3
|
* demux_mf: fix backward seeking behaviorwm42019-11-171-6/+8
| | | | | | | If SEEK_FORWARD is set, a demuxer should skip to the next frame if the timestamp does not fall on the start of a frame. If that flag is not set, it should always seek to the first frame before the target timestamp (or the first frame in the file).
* video: set EOF status as soon as possiblewm42019-11-171-1/+7
| | | | | | | | | | | | See what the added code comment says. Normally when this is needed, it's the cover art case. But this flag is not set when using an external image. This gives weird seek behavior, because the frame will be "normally" displayed for its determined duration, and during normal video playback, the video pts will be used - which is always 0 here. This should happen only if audio is active. Otherwise, we're more or less in image viewer mode, where the image should be displayed for a configured duration.
* video: if hr-seek goes past last frame, seek to last framewm42019-11-171-7/+6
| | | | | | | | | | | | This gives much better behavior in general, and is what we want if video somehow ends earlier than audio. A common special is using an audio file with an external image file. This commit makes things like switching aspect ratio work (provided the demuxer for the image behaves correctly, which currently isn't the case with demux_mf.c). Since the image file had timestamp 0, it was usually skipped by hr-seek, and changed properties weren't applied to it at the start of the filter chain.
* f_decoder_wrapper: put coverart through image output logicwm42019-11-171-2/+4
| | | | | | This wasn't done, probably regression from one of the last dozen of times this special code path was touched. This meant coverart images ignored the user-set aspect ratio completely, and some other things.
* vo_gpu: context_glx: Add X11 native resourcePhilip Langdale2019-11-161-0/+2
| | | | | | | Surprisingly, we've managed to get this far without context_glx ever adding the X11 display as a native resource. But with the recent change to attempt to enable vdpau when using EGL, the hwdec now requires the display to be added. So let's add it.
* wayland: use eglGetPlatformDisplay()Dudemanguy2019-11-161-1/+2
| | | | | See aacc194. The same logic all applies to Wayland. In fact, we already require EGL 1.5 for wayland anyway, so it's better to do it right.
* x11: require EGL 1.5 and use eglGetPlatformDisplay()wm42019-11-162-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eglGetPlatform() is a broken API, since it takes a windowing specific argument, yet is supposed to work for multiple APIs at the same time. On Linux, it can take both a X11 "Display" and a "wl_display". Obviously there is no way to specify what kind of display the argument is (it's just a void*). Mesa has _eglNativePlatformDetectNativeDisplay, which does funny stuff to try to guess the display type, including trying to call mincore() to determine whether the pointer can be accessed at all. I guess this recently accidentally broke (as a bug), but on the other hand, maybe it's time to do this properly. The fix is using eglGetPlaformDisplay(). This requires EGL 1.5, plus Mesa needs to support the associated platform extension (EGL_KHR_platform_x11). Since I see no reasonable way to do this in a compatible way, just require that EGL 1.5 is available. The problem is that EGL 1.4 seems to require you to create a display to query EGL version and extension, and you have a chicken-and-egg problem. It's very stupid. Maybe you could jump through some more hoops to get something compatible, but fuck that. Users on "too old" Mesa will fall back to GLX (which we keep around for a regrettable company known by the name of Nvidia). I think Wayland and GBM should do the same. They're sufficiently bleeding-edge that you can expect them to have EGL 1.5. On the other hand, the cursed RPI code will have to stay with a eglGetDisplay(). Speculative fix for #7154. (Rant about EGL follows. Actually I deleted it.)
* vo_gpu: sync duplicated condition on peak computationwm42019-11-161-0/+2
| | | | | | | | | | | | | | | | | | | | pass_color_map() (in video_shaders.c) and pass_colormanage() (video.c) both duplicate the condition on whether to do peak computation. Peak computation requires a compute shader, so if the duplicated conditions don't match, video_shaders.c will generate a compute shader, but video.c will try to run it as fragment shader. This leads to a "blue screen". This can be reproduced by playing a HDTV video with --target-peak=99. It's not clear how to fix this. Should pass_tone_map() be only invoked if mp_trc_is_hdr() == true (what pass_colormanage() uses to decide whether to enable peak computation), or should pass_colormanage() just tell pass_color_map() to skip peak computation? Decide for the latter, as it's more robust. Even if not correct, at least it gets rid of the blue shit. Fixes: #7149
* client API: remove sync. property notification code againwm42019-11-161-41/+14
| | | | |