summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* command: don't drop audio buffers when switching filterswm42015-03-171-1/+0
| | | | | | | | | This partially reverts commit ae7228c6. I guess the old behavior was slightly more popular. Fixes #1693 (probably). (cherry picked from commit 699fc0e51e4672d567f85a3589a140eda69c9ee2)
* command: allow changing some VO options even if VO wasn't created yetwm42015-03-151-4/+4
| | | | | | | | | | | | | | Instead of refusing to set properties like "fullscreen" if no VO was created, always allow it. So if no VO is created, setting the property merely changes the options (and will be applied once the VO is created). This is consistent with similar behavior changes to some other properties. Improves the behavior reported in #1676. Also, we shouldn't check the config_ok variable - the VO should do this. (cherry picked from commit e9841630ad2962e106ebf6c6d1afd032cbf93b33)
* player: fix crash when taking screenshots in idle modewm42015-03-151-0/+2
| | | | | | | | | | | | mpctx->filename is obviously not set if no file is playing. When this code was written, it probably couldn't happen, because the normal screenshot path fails much earlier in idle mode. But you can still take screenshots in "full window" mode, and recently the screenshot code was changed to use the "full window" mode if the normal path does not work. (cherry picked from commit ca474d22c98d678003cf5c94612d874d79eae442)
* Lua: add unpack shim for Lua 5.2/5.3 compatibility.torque2015-03-111-0/+2
| | | | | | | | | | | The global unpack function got moved to table.unpack in Lua 5.2, and it's only available as the global if 5.2 is built with compatibility enabled (the default). Lua 5.3 does not build with 5.1 compatibility by default. Fixes #1648. (cherry picked from commit 4ff29f33b0d86888a02524df5d6085c4bc29477e)
* player: allow changing playback speed in early audio init stageswm42015-03-111-1/+1
| | | | | | | | | | | If the audio decoder was created, but no audio filter chain created yet (still trying to decode a first audio frame), setting the "speed" property could explode. It tried to recreate the filter chain, even though no format was set yet. This is inconvenient and should not happen. (cherry picked from commit 720d4a5a1a82b2fa2da78dc2a3b1ca6ab87f973c)
* build: fix warnings with --disable-libasswm42015-03-051-2/+2
| | | | | | This crap seems to break every other fullmoon. (cherry picked from commit 0bbf36b796336c41ce8a7ef2054276254ba56067)
* player: refine rar:// playlist-safety handlingwm42015-03-031-3/+6
| | | | | | | | | | | | | | It was possible to make the player play local files by putting rar:// links into remote playlists, and some other potentially unsafe things. Redo the handling of it. Now the rar-redirector (the thing in demux_playlist.c) sets disable_safety, which makes the player open any playlist entries returned. This is fine, because it redirects to the same file anyway (just with different selection/interpretation of the contents). On the other hand, rar:// itself is now considered fully unsafe, which means that it is ignored if found in normal playlists. (cherry picked from commit a4b6bf8c41b54554286117b97e78412a32b5147f)
* Lua: add mp.get_screen_margins().torque2015-03-031-0/+12
| | | | | | | | When used with mp.get_screen_size(), mp.get_screen_margins() allows a Lua script to determine what portion of the mpv window actually has the video in it. (cherry picked from commit 1bbf1eb3ce2bdb0ef3ec3b045074bcb2f3af6a7a)
* player: adjust A/V desync messagewm42015-03-031-3/+3
| | | | | | | | Broken drivers are an issue rather often. Maybe this gives the user an idea that this could be the reason. (We can't dump much more info on a 80x24 terminal.) (cherry picked from commit a5f3083ae726452d07fca3ed8acdfbcaed84b0a7)
* Fix compilationDiogo Franco (Kovensky)2015-02-251-2/+5
| | | | Broken by unchecked cherry-picking of 53867aa.
* ytdl: add --no-warningswm42015-02-251-1/+1
| | | | | | | | Silences "[ytdl_hook] WARNING: video doesn't have subtitles", which was an annoying and pointless message printed with almost all youtube videos. (cherry picked from commit 7cff2e41316d508754b7b0725f5236de180f5cc2)
* ytdl: Adapt to new subtitles structureJaime Marquínez Ferrándiz2015-02-251-9/+11
| | | | | | The requested formats can be sorted by preference and the result gives now an url or the subtitles file content (cherry picked from commit 7281a72fabc610c70b4803ffb739c4155862c2d0)
* encoding: allow encoding to channel configurations other than stereowm42015-02-251-1/+3
| | | | | | | | | | | | A while ago, we made mpv output the native number of channels by default, instead of stereo. I assumed this was not wanted for encode mode. This commit keeps the assumption, but allows setting the number of audio output channels at all, instead of always forcing stereo. (Pretty much a hack.) (cherry picked from commit 636d6d724d36b90812a0c145bbf40143be9a52e8)
* player: fix demuxer lifetime managementwm42015-02-242-54/+43
| | | | | | | | | | | | | Commit f54220d9 attempted to improve this, but it got worse. Now there was a crash when ytdl_hook.lua added external tracks. This happened because close_unused_demuxers() assumed that sources[0] was the main demuxer (so that it didn't close it). This assumption failed, because the ytdl script can add external tracks before the main file is loaded. The easy fix would have been to check for master_demuxer, and not i==0. But instead give up on the old idea, make some stricter assumptions how demuxers and external tracks map, and simplify the code. (cherry picked from commit 53867aa9d834fd6a6314803655bd4c444d0e1df4)
* player: move timeline scanning (ordered chapters etc.) to a threadwm42015-02-211-7/+15
| | | | | | | | | | | | | | Do timeline building (scanning & opening reference files for ordered chapters, and more) in a thread. As a result, this process can actually be stopped without having to kill the player. This is pretty simple: just reuse the demuxer opening thread. We have to give up on the idea that open_demux_reentrant() is reusable, though. (Althoughthe timeline readers still need some fixes before they react to the quit request.) (cherry picked from commit 44411674ebb764adeb806040d24700bc4cc493cc)
* player: cosmetics: async/non-blocking -> reentrantwm42015-02-213-13/+13
| | | | | | | | These functions do blocking work on a separate thread, but wait until they return. So they are not async or non-blocking. But they do react to user-input and client API accesses, which makes them reentrant. (cherry picked from commit 2c305d5b2990d31911d7faa4c9117bf4eb89c88b)
* demux_edl: make independent from MPContextwm42015-02-192-6/+0
| | | | (cherry picked from commit d7a4cb14ff8dc61d87cec54abcd7f7623e8cc666)
* demux_edl: move implementationwm42015-02-191-302/+0
| | | | | | Same deal as with demux_cue, and a separate commit for the same reasons. (cherry picked from commit 1e44c811f3683f62714ff5ecc2e4f233eb8bb668)
* demux_cue: make independent from MPContextwm42015-02-192-5/+0
| | | | | | Also see previous commit(s). (cherry picked from commit 10781c2a9c175a8f9e445df4a91031301f225351)
* demux_cue: move implementationwm42015-02-191-415/+0
| | | | | | | | | | Move the implementation, of which most was in tl_cue.c, to demux_cue.c. Currently, this is illogical, because tl_cue.c still accesses MPContext. This is going to change, and then it will be better if everything is in demux_cue.c. This is only a separate commit to distinguish code movement and actual work; the next commit will do the actual work. (cherry picked from commit 7f03f46882ec4e9eb9d9857cf5cc393bb3afa7ca)
* matroska: move timeline code to demux/wm42015-02-191-654/+0
| | | | | | | Separate from previous commit, because git is bad at tracking file renames when the file contents are also changed. (cherry picked from commit edc0007e74ab4ad043f35eed8cdebd9ed73c8062)
* matroska: make timeline code independent of MPContextwm42015-02-193-114/+117
| | | | (cherry picked from commit 5a186d5942bda0c7cae56bc524a6dceccb5c7d3f)
* player: use a separate context for timeline loader stuffwm42015-02-192-22/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of accessing MPContext in player/timeline/*, create a separate context struct, which the timeline loaders fill out. It turns out that there's not much in the way too big MPContext that these need to access. One major PITA is managing (and closing) the set of open demuxers. The problem is that we need a list of all demuxers to make sure no unneeded streams are enabled. This adds a callback to the demuxer_desc struct, with the intention of leaving to to the demuxer to call the right loader, instead of explicitly checking the demuxer type and dispatching manually in common code. I also considered making the timeline part of the demuxer state, but decided against: it's too much of a mess wrt. memory management and threading, and also doesn't make it clear who owns the child demuxers. With the struct timeline decoupled from the demuxer state, it's at least somewhat clear that the child demuxers are independent from the "main" demuxer. The actual changes to player/timeline/* are separated in the following commits, because they're quite verbose. Some artifacts will be removed later as soon as there's only 1 timeline loading mechanism. (cherry picked from commit a0a089f6a48c2775478b544185a0ddeabf43cce8)
* player: use a macro to remove an element from an arraywm42015-02-191-6/+1
| | | | | | Should be equivalent. (cherry picked from commit 969edb9e0b86500ed0af9c26209ad7000adb5157)
* player: actually close files when using sub_removewm42015-02-191-13/+38
| | | | | | | | | | | Also effects some other cases. The real reason for this is for keeping track of which demuxers can be closed (see following commit). Since I don't want to use reference counting for this, some sort of simplistic mark-and-sweep is done to determine whether a demuxer is still needed. (cherry picked from commit f54220d95150ee53a33cc6626b7d0ff8b235c7f0)
* osxbundle: config file special case isn't needed anymorewm42015-02-161-6/+0
| | | | | | | | The previous commit effectively fixes the mess caused by 'config' vs. 'mpv.conf', and the hack introduced by commit e01a6dac and extended by commit db167cd4 isn't needed anymore. (cherry picked from commit 816d7bba1f3842146fa12c98232070559e72e807)
* player: undeprecate 'config' fileswm42015-02-161-22/+5
| | | | | | | | | Actually, it's pretty simple to look for multiple filenames at once, since mp_find_all_config_files() is already a bit "special" anyway. See #1569. Reverts most of commit db167cd4 (keeps osx-bundle.conf). (cherry picked from commit a27aa68dd33c613218d261b14ef1cf763abc1c33)
* Fix build on OSX broken by previous commitwm42015-02-161-1/+1
| | | | | | Hopefully. (cherry picked from commit 5247416735e86417d466f0137cf907b5921602a1)
* vf_vapoursynth: add display refresh rate propertyJulian2015-02-161-0/+2
| | | | | | | This value is not necessarily trustworthy (it might change) and can be 0. (cherry picked from commit 349067a6ab2d03024b3e984e80314f303dd14432)
* player: deprecate 'config' files (use mpv.conf), warn against clasheswm42015-02-161-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently there's at least one distro which ships a /etc/mpv/mpv.conf file (mpv doesn't install such a file). This breaks config files named 'config' located in the user's mpv config directory, because mpv first loads files named 'config' and then 'mpv.conf'. There is no mechanism for putting files with different names into the same config path order. (Even worse, that mpv.conf file only set an option to the default value. Why do distros always do very stupid things?) Print a warning on collisions. Although using 'config' was well-supported, supporting both names is starting to become messy, so deprecate 'config' and print a warning if one is found. At least we will be able to remove the whole mess once 'config' files are ignored... This also affects the osx-bundle, which intentionally used these not-so- optimal semantics. Solve it in a different way. (Unfortunately with an ifdef - it's not required, but having to explain everyone why mpv tries to load a osx-bundle.mpv file on Linux and Windows would consume energy.) Closes #1569. (cherry picked from commit db167cd438b516371bc2a7b6e08a57f2054dc742)
* command: mark get_property as deprecatedwm42015-02-161-0/+4
| | | | | | | Using it just makes no sense. But we're really being nice about this and don't remove it immediately. (cherry picked from commit fd5403cb404ca8fb30c2c6b1f415201bbce40d77)
* encoding: fixed-vo option was removedwm42015-02-161-1/+0
| | | | (cherry picked from commit 96547a810e87d06121704ed67e3cf44430752c67)
* player: add a --loop=force modewm42015-02-162-8/+6
| | | | | | | | | Requested. See manpage additions. This also makes the magical loop_times constants slightly saner, but shouldn't change the semantics of any existing --loop option values. (cherry picked from commit aee0978d50e21d8f114382fdb9c014c029f71a04)
* osx: move code to unset input context to the right placewm42015-02-161-4/+4
| | | | | | | | | Setting the input context is always called, both in cplayer and libmpv, and under HAVE_COCOA. Unsetting the input context was done only the cplayer uninit call. Also it was under HAVE_COCOA_APPLICATION, so it was not unset in libmpv (dangling pointer). (cherry picked from commit c59a4f12db96784b054f28d52eaa33cb7553d630)
* osx: move cocoa specific call out of common codewm42015-02-161-8/+0
| | | | This is almost equivalent, and gets rid of the ifdef.
* player: drop explicit exit() callswm42015-02-161-14/+9
| | | | | | | | | | | The code in main.c calls exit() explicitly, but the code is actually easier to follow by simply exiting from main() instead. The exit() call in av_log.c happens only on severely broken builds, so replace it with abort(). (Shuts up rpmlint warnings.) (cherry picked from commit e920a00ebad645cd14d341f4dabd4c5c077d2e0c)
* Revert "player: make --force-window create the window immediately on start"wm42015-02-121-1/+0
| | | | | | | | | | | | | This reverts commit acc5e8f57419debdb74234a228b44db75023e28b. As expected, some didn't like this. Others won't like this revert. Whatever. See #1561. This should go into mpv 0.8.0 before it's released. (cherry picked from commit 7bbc6170193a22d5d66370e4e3a97d23bcbc3903)
* tl_matroska: only check the chapter count when adding chaptersBen Boeckel2015-02-061-3/+3
| | | | | | | Fixes #1445 without failing in the case where file outside.mkv with N chapters references inside.mkv with N+1 chapters. Since we don't care about the number of chapters in inner files (yet; nested chapters would change this, but also make chapters dynamic anyways), don't check there.
* tl_matroska: squeeze down the number of parametersBen Boeckel2015-02-061-62/+77
| | | | | | Much cleaner. The difference between timeline_info and inner_timeline_info is that timeline_info is stuff the top-level cares about and inner_timeline_info is just for the current chapter.
* player: do not autoload audio with audio files, enable autoloadingwm42015-02-051-0/+12
| | | | | | | | | | | | | | Autoload external audio files only if there's at least a video track (which is not coverart pseudo-video). Enable external audio file autoloading by default. Now that we actively avoid doing stupid things like loading an external audio file for an audio-only file, this should be fine. Additionally, don't autoload subtitles if a subtitle is played. Although you currently can't play subtitles without audio or video, it's disturbing and stupid that the player might load subtitle files with different extension and then fail.
* matroska: warn against mismatching segmentswm42015-02-041-0/+49
| | | | | | | | Matroska ordered chapters require all segment files to have the same layout. If a referenced file has more tracks than the main file or misses some tracks, the file is invalid. Also see issue #1553.
* player: move timeline specific handling to timeline loaderswm42015-02-044-14/+14
| | | | In particular, gets rid of the Matroska specifics from the common code.
* command: add on_unload hookwm42015-02-041-0/+10
| | | | Fixes #1552.
* player: make --force-window create the window immediately on startwm42015-02-031-0/+1
| | | | | | | | | | | | | | | | Before this change, window creation was delayed until the video was initialized. This guaranteed that the first window size was that of the video, so the WM would place it correctly. Some time ago, it was requested on the IRC channel that --force-window should not do this. Sometimes, it can take a while until video is initialized, e.g. when youtube-dl is used (which incurs lots of network delay). In this case, it's awkward that it takes so long until a window (any window) is shown. On the other hand, this can cause incorrect window placement with some WMs. We simply hope that this won't happen with modern WMs. (Although it does with the WM I use, crappy old IceWM.)
* player: remove --fixed-vowm42015-02-033-7/+2
| | | | | | | In ancient times, this was needed because it was not default, and many VOs had problems with it. But it was always default in mpv, and all VOs are required to deal with it. Also, running --fixed-vo=no is not useful and just creates weird corner cases. Get rid of it.
* command: new commands audio_add/audio_remove/audio_reloadxylosper2015-02-033-34/+37
| | | | | | | | These commands are counterparts of sub_add/sub_remove/sub_reload which work for external audio file. Signed-off-by: wm4 <wm4@nowhere> (minor simplification)
* command: add property returning detected audio deviceStefano Pigozzi2015-02-031-1/+11
| | | | | This can be useful to adjust some other audio related properties at runtime depending on the audio device being used.
* command: add property returning detected hwdec APIwm42015-02-021-1/+32
| | | | | | | | | This is somewhat imperfect, because detection of hw decoding APIs is mostly done on demand, and often avoided if not necessary. (For example, we know very well that there are no hw decoders for certain codecs.) This also requires every hwdec backend to identify itself (see hwdec.h changes).
* player: add external audio file auto-loadingwm42015-02-021-44/+58
| | | | | | Apparently some people want this. Not enabled by default. Fixes #967.
* command: add properties returning the current VO and AO driverwm42015-02-021-2/+18
| | | | This wasn't possible before.
* client API: add mpv_wait_async_requests()wm42015-02-021-8/+12
| | | | | | | | | | | | | | | | | | | | This does what it's documented to do. The implementation reuses the code in mpv_detach_destroy(). Due to the way async requests currently work, just sending a synchronous dummy request (like a "ignore" command) would be enough to ensure synchronization, but this code will continue to work even if this changes. The line "ctx->event_mask = 0;" is removed, but it shouldn't be needed. (If a client is somehow very slow to terminate, this could silence an annoying queue overflow message, but all in all it does nothing.) Calling mpv_wait_async_requests() and mpv_wait_event() concurrently is in theory allowed, so change pthread_cond_signal() to pthread_cond_broadcast() to avoid missed wakeups. As requested in issue #1542.
* command: add dummy get implementation for tv-channel propertywm42015-02-021-0/+2
| | | | | A small cosmetic change with the effect that pressing 'k' shows "unavailable" instead of "error" (even if no TV code is active).
* player: dump audio jitter to stats filewm42015-02-011-4/+5
| | | | | This allows us to plot the difference between video timestamps, and the adjusted video timestamps due to syncing video to audio speed.
* command: send additional property change events in-between loadingwm42015-02-013-0/+3
| | | | | | | | Opening the stream and opening the demuxer are both done asynchronously, meaning the player reacts to client API requests. They also can potentially take a while. Thus it's better to process outstanding property changes, so that change events are sent for properties that were changed during opening.
* command: improve observability of some audio propertieswm42015-02-011-1/+2
| | | | | | | | | In particular, this would fix the sending the initial change event. It was easily missed because MPV_EVENT_FILE_LOADED usually triggered it, but the actual property could change only later, because audio initialization really is kind of asynchronous to it. This probably fixes #1544.
* player: don't treat audio playback restart while paused specialwm42015-01-301-4/+1
| | | | | | I guess this was supposed to be some sort of optimization, but even though it probably works, it's pretty meaningless and I couldn't measure a difference. One special case killed.
* player: minor simplification in A/V-sync related codewm42015-01-302-10/+6
| | | | Just minor things.
* Revert