aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* vo, ao: disable positional parameter suboptionsGravatar wm42016-09-01
| | | | | | | | | | | | | | | | Positional parameters cause problems because they can be ambiguous with flag options. If a flag option is removed or turned into a non-flag option, it'll usually be interpreted as value for the first sub-option (as positional parameter), resulting in very confusing error messages. This changes it into a simple "option not found" error. I don't expect that anyone really used positional parameters with --vo or --ao. Although the docs for --ao=pulse seem to encourage positional parameters for the host/sink options, which means it could possibly annoy some PulseAudio users. --vf and --af are still mostly used with positional parameters, so this must be a configurable option in the option parser.
* stream_cb: remove broken castGravatar wm42016-08-31
| | | | | | | seek_fn is supposed to return the new file offset, or a negative error code. Our code doesn't use the offset, and only wants to know if any errors happened. The int cast is completely broken and might treat a successful seek as failed depending on whether the sign bit will be set.
* m_config: remove an unused functionGravatar wm42016-08-31
| | | | Well, almost unused.
* vo: update w32_common left out by 4d75514Gravatar quilloss2016-08-31
|
* m_config: remove some aliasing checksGravatar wm42016-08-31
| | | | | We strictly assume no aliasing (the previous commit removed the last case), so remove the checks.
* m_option: replace --no-video-aspect aliasGravatar wm42016-08-31
| | | | | | | | | Instead, add a hacky OPT_ASPECT option type, which only exists to accept a "no" parameter, which in combination with the "--no-..." handling code makes --no-video-aspect work again. We can also remove the code in m_config.c, which only existed to make "--no-aspect" (a deprecated alias) to work.
* m_config: deprecate top-level suboptionsGravatar wm42016-08-31
| | | | | | | | | | | | | | | This is a really old weird MPlayer feature. While the MPlayer requires you to use the sub-option syntax in these cases, mpv "flattens" them to normal options. The still-supported alternate sub-option syntax remains a weird artifact that hopefully nobody uses. For example you can do "-sub-text font=Foo:color=0.5" instead of using "--sub-text-font=Foo --sub-text-color=0.5". For --sub-text this is an accidental feature, but it used to be documented for --demuxer-rawaudio and some others. This should just be removed, but for now only print a warning to preempt complaints from weird users wanting this feature back.
* client API: deprecate "no-..." option handlingGravatar wm42016-08-31
| | | | | | | | The client API can do this (and there are apparently some libmpv using projects which rely on this). But it's just unnecessary bloat as it requires a separate code path from the option parser. It would be better to remove this code. Formally deprecate it, including API bump and warning in the API changes file to make it really clear.
* m_config: introduce and use OPT_ALIAS for some optionsGravatar wm42016-08-31
| | | | | | | | | | | | | | OPT_ALIAS redirects the options at a higher level, instead of introducing "duplicate" options with different name but same backing storage. This uses the OPT_REPLACED mechanisms - only the deprecation warning had to be made conditional. Note that e.g. --no-video still works, because the "--no-..." redirection and OPT_ALIAS are orthogonal. The deprecated --sub -> --sub-file alias had to be dropped, because it essentially conflicts with --no-sub. If anyone complains, this could probably still be undone by letting m_config_find_negation_opt do a special mapping for --no-sub. (Which would be dumb, but simple and effective.)
* m_config: handle --no-... options differentlyGravatar wm42016-08-31
| | | | | | | Instead of adding "no-"-prefixed aliases to the internal option list, which will act like normal options, do it in the parsing stage. This turns out to be simpler (and cheaper), and avoids adding aliased options.
* m_property: remove pointless explicitly clampingGravatar wm42016-08-31
| | | | | | | | | This is basically dead code, and even the commit that added this code 4 years ago said that this should be for debugging only. (Though it is possible that the clamp callback was used for something else, and then unused again. Also, some of the clamping code remains and is used for internal checking, e.g. clamp_double().)
* input: use OPT_REPLACED for an old option aliasGravatar wm42016-08-31
|
* vo_xv: remove an aliased optionGravatar wm42016-08-31
| | | | | Trying to get rid of them, and no-colorkey is an instance of it. Kill it.
* vo: change messy handling of fullscreen and other flagsGravatar wm42016-08-30
| | | | | | | | | | | | | | Before this commit, all VOs had to toggle the option flag themselves, now command.c does it. I can't really comprehend why it required every VO to do this manually. Maybe it was for rejecting the property/option change if the VO didn't support a specific capability. But then it could have checked the VOCTRL result. In any case, I don't care, and successfully changing the property without doing anything (With some VOs) is fine too. Many things work this way now, and it's simpler overall. This change will be useful for cleaning up VO option handling.
* options: make mp_vo_opts options an actual sub-option groupGravatar wm42016-08-30
| | | | | | | | | | | Just a minor refactor along the planned option change. This commit will make it easier to update (i.e. copy) the VO options without copying _all_ options. For now, behavior should be equivalent, though. (The VO options were put into a separate struct quite early - when all global variables were removed from the source code. It wasn't clear whether the separate struct would have any actual purpose, but it seems it will now. Awesome, huh.)
* m_config: pass parent option in m_config_add_option()Gravatar wm42016-08-30
| | | | | Instead of just the parent name. This is a minor refactor as preparation for other things.
* m_config: rename is_generated to is_hiddenGravatar wm42016-08-30
| | | | | | More appropriate. Originally it really was for automatically added options, but now it even needed some stupid comments to indicate that it was used for simply hiding options.
* m_option: remove M_OPT_TYPE_DYNAMIC flagGravatar wm42016-08-30
| | | | | | It's actually redundant with whether m_option_type.free is set. Some option types were flagged inconsistently. Its only use was for running an additional sanity check without any real functionality.
* command: cosmetics: fix some minor whitespace mistakesGravatar wm42016-08-30
|
* player: make --force-window work with opengl-cbGravatar wm42016-08-30
| | | | | No reason not to? This probably avoids surprises if someone really tries to combine them.
* player: slightly adjust framerate guessing heuristicGravatar wm42016-08-29
| | | | | | | | | | | | | | | | | | | | | | Some files not only use rounded timestamps, but they also do it incorrectly. They may jitter between up to 4 specific frame durations. In this case, I found a file that mostly used 41ms and 42ms, but also had 40ms and 43ms outliers (often but not always following each other). This breaks the assumption of the framerate estimation code that the frame duration can deviate up to 1ms. If it jitters around 4 possible frame durations, the maximum deviation is 3ms. Increase it accordingly. The change might make playback of "true VFR" video via display-sync mode worse, but it's not like it was particularly good in the first place. Also, the check whether to usen the container FPS needs to be stricter. In the worst case, num_dur is 1, which doesn't really indicate any evidence that the framerate is correct. Only if there are "enough" frames the deviation check will become meaningful. 16 is an arbitrary value that has been designated "enough" by myself. Also otuput the frame duration values for --dump-stats.
* Merge pull request #3467 from atomnuker/masterGravatar Rostislav Pehlivanov2016-08-29
|\ | | | | wayland: reject resize events with either dimension being 0
| * wayland: reject resize events with either dimension being 0Gravatar Rostislav Pehlivanov2016-08-29
|/ | | | Newer versions of mutter/gnome now ask mpv to resize to 0 by 0 pixels.
* vo_opengl: explicitly check for GL errors around framebuffer depth checkGravatar wm42016-08-29
| | | | | | | | It seems like many GL implementations (including Mesa) choke on this, while others are fine. We still think that this use of the GL API is allowed by the standard (at least in the Mesa case), so to reduce confusion, explicitly check the "controversial" calls, and use an appropriate error message.
* sd_lavc: always set decoder timebaseGravatar wm42016-08-29
| | | | | | | | Like it's done for audio and video. Just to be uniform. I'm sorry for deleting the anti-ffmpeg vitriol. It's still all true, but since we decided to always set the timebase, the crappiness is isolated to FFmpeg internals.
* vd_lavc: always force milliseconds for MMALGravatar wm42016-08-29
| | | | | This libavcodec wrapper should rescale the API timestamps to whatever it internally needs, but it doesn't yet. So restore this code.
* vd_lavc, ad_lavc: set pkt_timebase, not time_baseGravatar wm42016-08-29
| | | | | | | | | These are different AVCodecContext fields. pkt_timebase is the correct one for identifying the unit of packet/frame timestamps when decoding, while time_base is for encoding. Some decoders also overwrite the time_base field with some unrelated codec metadata. pkt_timebase does not exist in Libav, so an #if is required.
* m_config: profile option values can be NULLGravatar wm42016-08-29
| | | | Sigh.
* command: export profile list as a propertyGravatar wm42016-08-28
| | | | | | | Targeted at scripts, which can do whatever they want with it. This comes with the promise that they could get randomly broken any time. See #977.
* misc: add some annoying mpv_node helpersGravatar wm42016-08-28
| | | | | | | Sigh. Some parts of mpv essentially duplicate this code (with varrying levels of triviality) - this can be fixed "later".
* common: add assert.h includeGravatar wm42016-08-28
| | | | Because why not.
* player: add option to disable video OSDGravatar wm42016-08-28
| | | | | | | | | | | | | | Normally, OSD can be disabled with --osd-level=0. But this also disables terminal OSD, and some users want _only_ the terminal OSD. Add --video-osd=no, which essentially disables the video OSD. Ideally, it should probably be possible to control terminal and video OSD levels independently, but that would require separate OSD timers (and other state) for both components, so don't do it. But because the current situation isn't too ideal, add a threat to the manpage that might be changed in the future. Fixes #3387.
* command: add property for current subtitle textGravatar wm42016-08-27
| | | | Requested by someone. Reuses the code for terminal subtitle display.
* player: fix minor spelling mistake in osc.luaGravatar James Cowgill2016-08-27
| | | | | Lintain (https://lintian.debian.org/) complains about this particular spelling mistake.
* TOOLS/zsh.pl: add m4a to zsh completion filetype listGravatar wgmk2016-08-26
|
* player: avoid some redundant terminal status updatesGravatar wm42016-08-26
| | | | | Run term_osd_update() just once per update, instead of twice (once for the status line, and once for the terminal OSD messafe).
* x11, wayland: always round up wait timesGravatar wm42016-08-26
| | | | | If wait_us is >0 and <500, the wait time gets rounded down 0, effectively turning this into busy waiting. Round it up instead.
* vo: remove redundant wakeupGravatar wm42016-08-26
| | | | | Shouldn't matter. Was pointed out by someone. The change should help avoiding extra unneeded wakeups on the VO thread.
* demux: close underlying stream if it's fully read anywayGravatar wm42016-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is for text subtitles. libavformat currently always reads text subtitles completely on init. This means the underlying stream is useless and will consume resources for various reasons (network connection, file handles, cache memory). Take care of this by closing the underlying stream if we think the demuxer has read everything. Since libavformat doesn't export whether it did (or whether it may access the stream again in the future), we rely on a whitelist. Also, instead of setting the stream to NULL or so, set it to an empty dummy stream. This way we don't have to litter the code with NULL checks. demux_lavf.c needs extra changes, because it tries to do clever things for the sake of subtitle charset conversion. The main reason we keep the demuxer etc. open is because we fell for libavformat being so generic, and we tried to remove corresponding special-cases in the higher-level player code. Some of this is forced due to ass/srt mkv/mp4 demuxing being very similar to external text files. In the future it might be better to do this in a more straight-forward way, such as reading text subtitles into libass and then discarding the demuxer entirely, but for aforementioned reasons this could be more of a mess than the solution introduced by this commit. Probably fixes #3456.
* player: don't directly access demuxer->streamGravatar wm42016-08-26
| | | | | | | | | | Cleaner and makes it easier to change the underlying stream. mp_property_stream_capture() still directly accesses it directly via demux_run_on_thread(). This is evil, but still somewhat sane and is not getting into the way here. Not sure if I got all field accesses.
* cache: don't use a backbuffer if the cache is as large as the fileGravatar wm42016-08-26
| | | | | | | | | | | | It's just wasted memory. One corner case is when a file grows during playback, but this is rare and usually happens on-disk only. The cache size was generally limited before this change already, so no reason to care. As an unrelated change, move the cache size info to the resize_cache() function. There's really no reason not to do this, and it's slightly more informative if the user changes the cache size at runtime.
* stream_memory: disable stream cacheGravatar wm42016-08-26
| | | | Obviously makes no sense and just wastes resources.
* w32_common: use hooks to detect parent window resizeGravatar James Ross-Gowan2016-08-26
| | | | | | | | | | | | | | | | | | | | | | | Because VOCTRL_CHECK_EVENTS is processed asynchronously (as of 088a007,) the GUI thread no longer gets regular wakeups, so the old check that made sure the video window matched the parent window's size in --wid embedding mode did not run very often. This made --wid embedding not very usable. Instead of polling for window size changes, use Windows hooks to react to them when they happen. When the parent window is owned by the same process as the video window, use a WH_CALLWNDPROC hook. When the parent window is not owned by the same process, WinEvents must be used, which are not as smooth, but still work for this purpose. Since neither SetWindowsHookEx nor SetWinEventHook take a context parameter to send data to the hook function, the hook functions must find the child window by its class instead, so there are a few changes to ensure this is fast and the class is unique. This also fixes up the logic to handle window destruction. When a parent window is destroyed, its children are also destroyed, so this gives us a way to react to parent window destruction without polling.
* vo_opengl: angle: new opengl flag to control DirectCompositionGravatar Avi Halachmi (:avih)2016-08-25
| | | | | On some systems DirectComposition might behave poorly. Add an opengl suboption flag 'dcomposition' (default=yes) which can disable it.
* x11: work around mutter fullscreen issueGravatar wm42016-08-25
| | | | | | | | | | | | | | | | | | | | | | | | If the video has the same size as the screen, starting with --fs and then leaving fullscreen doesn't actually leave fullscreen. The reason is that mpv tries to restore the previous window size if necessary (otherwise, you'd end up with a Window of nearly the same size as the screen with some WMs). It will typically restore with the rectangle set exactly to the screen if no other position or size is forced. This triggers pre-EWMH fullscreen mode, which WMs detect using various heuristics. Apparently we triggered this with mutter (but strangely no other WMs). It's possible that pre-EWMH fullscreen mode actually requires removing decorations, and mutter either ignores this. But this is speculation and I haven't checked. Work this around by reducing the requested size by 1 pixel if it happens. This was observed with mutter 3.18.2. Fixes #2072.
* audio: avoid missed wakeups with ab-loopsGravatar wm42016-08-24
| | | | Could get "stuck".
* vd_lavc: minor simplificationGravatar wm42016-08-23
| | | | The timebase is now always valid.
* ad_lavc: actually tell decoder about the timebaseGravatar wm42016-08-23
| | | | Essentially forgotten in commit 05e4df3f.
* ao_alsa: log if retrieving supported channel maps failsGravatar wm42016-08-22
| | | | It's a sign that the driver doesn't implement the channel map API.
* audio: do not apply --audio-channels if spdif passthrough is in useGravatar wm42016-08-22
| | | | | | | | If spdif is enabled, the channel layout has no meaning other than setting the number of channels. The number of channels must be fixed to achieve the exact bitrate required. Fixes #3445.