summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* screenshot: use GPU readback only for hardware decoded imageswm42015-04-071-1/+1
| | | | | | Avoids a confusing message printed by the vdpau code when taking a screenshot while using software decoding (because obviously GPU readback won't work on normal in-memory video frames).
* command: new subproperty for video-params: gammaNiklas Haas2015-04-041-0/+5
|
* video: cleanup stereo mode parsingwm42015-04-021-1/+1
| | | | | | | | | Use OPT_CHOICE_C() instead of the custom parser. The functionality is pretty much equivalent. (On a side note, it seems --video-stereo-mode can't be removed, because it controls whether to "reduce" stereo video to mono, which is also the default. In fact I'm not sure how this should be handled at all.)
* player: add --idle --keep-open to pseudo-gui profilewm42015-04-021-0/+2
|
* player: add "pseudo-gui" profilewm42015-04-021-0/+8
| | | | | | | | | | | | | | This can be set to select a number of default settings that help mpv pretend that it has a GUI. I haven't decided yet whether I really want to use the profile mechanism for this. There are a number of weird details that are not so easy to handle with profiles, such as disabling pseudo-gui mode again (you can't unset profiles directly). So this might change. But for now it will do. There also should be a better way to store builtin profiles. Unfortunately, the old crappy MPlayer config file parser needs on-disk files, so just use a bunch of function calls for now.
* lua: reject Lua 5.3wm42015-04-011-0/+5
| | | | | | | | | | | | | | It simply doesn't work, and is hard to make work. Lua 5.3 is a different language from 5.1 and 5.2, and is different enough to make adding support a major issue. Most importantly, 5.3 introduced integer types, which completely mess up any code which deals with numbers. I tried to make this a compile time check, but failed. Still at least try to avoid selecting the 5.3 pkg-config package when the generic "lua" name is used (why can't Lua upstream just provide an official .pc file...). Maybe this actually covers all cases. Fixes #1729 (kind of).
* command: remove unused functionwm42015-04-011-14/+0
|
* video: move colorspace overrides to vf_format, simplifywm42015-03-311-120/+21
| | | | | | | | | | | | | | | | | | | Remove the colorspace-related top-level options, add them to vf_format. They are rather obscure and not needed often, so it's better to get them out of the way. In particular, this gets rid of the semi-complicated logic in command.c (most of which was needed for OSD display and the direct feedback from the VO). It removes the duplicated color-related name mappings. This removes the ability to write the colormatrix and related properties. Since filters can be changed at runtime, there's no loss of functionality, except that you can't cycle automatically through the color constants anymore (but who needs to do this). This also changes the type of the mp_csp_names and related variables, so they can directly be used with OPT_CHOICE. This probably ended up a bit awkward, for the sake of not adding a new option type which would have used the previous format.
* build: make posix_spawn() mandatorywm42015-03-301-4/+0
| | | | | | | It was already accidentally used unconditionally by command.c. Apparently this worked well for us, so don't change anything about, but should it be unavailable, fail at configure time instead of compile time.
* video: fix seek-to-last-framewm42015-03-261-3/+1
| | | | | Accidentally broken in 79779616; we really need to check for true EOF, not just whether there are no frames yet.
* player: relax assertion on mp_set_playlist_entryNiklas Haas2015-03-261-1/+1
| | | | | This assertion crashed when e was NULL, which can happen when using force.
* video: make frame skipping code slightly more readablewm42015-03-251-13/+8
|
* video: refactor aspects of queue and EOF handlingwm42015-03-251-41/+62
| | | | | Instead of touching the 2-entry queue in mpctx->next_frame directly, move some of it to functions.
* lua: replace getcwd() implementationwm42015-03-242-14/+4
|
* command: add property returning current working directorywm42015-03-241-0/+20
| | | | Requested; fixes #1717.
* audio: increase maximum amount of audio skipped for seekingwm42015-03-241-1/+1
| | | | | | | | | | | Precise seeking requires skipping audio, since the demuxer usually doesn't seek precisely enough. There is a sanity check that prevents skipping more than 300 seconds of audio. This still fails with very large mp3s. For example, with a 1GB sized mp3 with Xing headers, entries will be 4 MB apart on average, and occasionally much more. Just bump the limit. I'm not even sure why it was added in the first place; I suppose it's most important for files with real PTS resets.
* client API: remove dead assignmentwm42015-03-231-1/+0
| | | | | Probably a leftover from an earlier refactoring. Now data is always in the format MPV_FORMAT_NODE.
* video: use less technical language for PTS warningwm42015-03-231-1/+1
| | | | | | | "Non-monotonic" isn't even 100% correct; it's missing "strictly" (for briefness I guess), and also the message is printed if the PTS jumps forward. So just print something that is likely a bit easier to understand.
* encode: make --audio-channels=auto workwm42015-03-231-2/+4
| | | | Basically requested. Not that anyone cares.
* video: fix update of vo-configured propertywm42015-03-231-0/+1
| | | | It obviously needs to be updated after the VO was destroyed.
* vo_opengl_cb: don't render OSD while VO is not createdwm42015-03-232-2/+1
| | | | | | | | | | | Unlike other VOs, this rendered OSD even while no VO was created (because the renderer lives as long as the API user wants). Change this, and refactor the code so that the OSD object is accessible only while the VO is created. (There is a short time where the OSD can still be accessed even after VO destruction - this is not a race condition, though it's inelegant and unfortunately unavoidable.)
* command: use mp_set_playlist_entrySai Ke WANG2015-03-221-3/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* player: fix seekability testwm42015-03-201-1/+1
| | | | | Commit 39ed9b7d9 got this wrong, because these shitty flags are so goddamn confusing.
* player: warn against non-monotonic video PTS only oncewm42015-03-181-8/+9
| | | | | | | | For some reason there were two points in the code where it warned against non-monotonic video PTS. The one in video.c triggered on PTS going backwards or making large jumps forwards, while dec_video.c triggered on PTS going backwards or PTS not changing. Merge them into a single check, which warns against all cases.
* player: refuse to write resume file with unseekable fileswm42015-03-181-0/+6
| | | | | | | In fact this should happen on resume, not on saving, but it's simpler this way. Fixes #1701.
* osd: simplify an aspect of change detection handlingwm42015-03-181-1/+1
| | | | | | | | | | | | | | | | | | There was a somewhat obscure optimization in the OSD and subtitle rendering path: if only the position of the sub-images changed, and not the actual image data, uploading of the image data could be skipped. In theory, this could speed up things like scrolling subtitles. But it turns out that even in the rare cases subtitles have such scrolls or axis-aligned movement, modern libass rarely signals this kind of change. Possibly this is because of sub-pixel handling and such, which break this. As such, it's a worthless optimization and just introduces additional complexity and subtle bugs (especially in cases libass does the opposite: incorrectly signaling a position change only, which happened before). Remove this optimization, and rename bitmap_pos_id to change_id.
* command: don't drop audio buffers when switching filterswm42015-03-161-1/+0
| | | | | | | This partially reverts commit ae7228c6. I guess the old behavior was slightly more popular. Fixes #1693 (probably).
* command: make "media-title" observablewm42015-03-151-1/+1
| | | | If metadata changes, its value could change.
* command: fix display-fps property (again)wm42015-03-131-3/+3
| | | | | | | This caused complaints because the fps was basically rounded on microsecond boundaries in the vsync interval (it seemed convenient to store only the vsync interval). So store the fps as float too, and let the "display-fps" property return it directly.
* command: display-fps is the display FPS as assumed by the VOwm42015-03-121-4/+4
| | | | | | | | | Requested change in behavior. Note that we set the assumed "infinite" display_fps to 1e6, which conveniently lets vo_get_vsync_interval() return a dummy value of 1, which can be easily checked against, and still avoids doing math with float INFs.
* player: dump list of satisfied deps instead of config.h with -vwm42015-03-111-1/+1
| | | | | | Starting to get tired of seeing the full config.h in verbose output every time. Make it slightly more elegant by outputting the list of satisfied dependencies instead.
* command: allow changing some VO options even if VO wasn't created yetwm42015-03-111-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.
* player: fix crash when taking screenshots in idle modewm42015-03-111-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.
* audio: cut audio with spdif too on playback restartwm42015-03-101-3/+3
| | | | | | | | | | | | | | | | | | | When playback is started after seeking or opening a file, we need to make sure audio and video line up exactly. This is done by cutting or padding the audio stream to start on the video PTS. This does not quite work with spdif: audio is compressed data, within a spdif frame. There is no way to cut the audio "in between" the frames. Cutting between the frames would just produce broken spdif packets, and who knows how receivers will react to this (play noise?). But we still can cut it in frame boundaries. Unfortunately, we also insert 0 data for "silence" - we probably shouldn't do this. Chances are the receiver will switch to PCM or so. But for now this will have to do. Note that this could be simplified somewhat, as soon as we work with frames. See previous commit.
* command: add display-fps propertywm42015-03-101-1/+17
| | | | Requested. Untested; leaving that to the users.
* player: restore --dump-statswm42015-03-101-6/+6
| | | | | Since the recent refactoring, it was initialized _before_ the command line player options were set, and consequently could not be enabled.
* audio: refuse to change playback speed with spdifwm42015-03-071-2/+4
| | | | | | | | | | | | Handle the failure gracefully, instead of exploding and disabling audio. Just set the speed back to 1.0. Also remove the AF_DETACH from af_scaletempo. This actually created a dangling pointer in af_add(), a tricky consequence of af_add() reconfiguring the filter chain and the newly added filter using AF_DETACH. Fortunately the AF_DETACH is not needed (and probably never worked - it comes from MPlayer times, and MPlayer also disables audio when trying to change speed with spdif).
* audio: make changing playback speed slightly more robustwm42015-03-071-32/+39
| | | | | | | | | | | Always use af_scaletempo if it's inserted, even if the option --audio-pitch-correction=no is set. Make sure all filters are reset on speed change. It's conceivable that dynamic changes to the filter chain at runtime leave filters around without resetting their speed parameters. Also move the code to a separate function.
* Lua: add unpack shim for Lua 5.2/5.3 compatibility.torque2015-03-061-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.
* player: allow changing playback speed in early audio init stageswm42015-03-061-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.
* player: fix operation if command line is emptywm42015-03-061-10/+11
| | | | | | | main() being called with argc==0 is probably possible. Fix by skipping the program name early. (I already changed and reverted this once, but this time we make sure that it's less likely to confuse the skipped argv with main()'s argv by naming it "options".)
* player, client API: refactor cplayer init, reduce client API differenceswm42015-03-053-48/+51
| | | | | | | | | | | | | Move the command line parsing and some other things to the common init routine shared between command line player and client API. This means they're using almost exactly the same code now. The main intended side effect is that the client API will load mpv.conf; though still only if config loading is enabled. (The cplayer still avoids creating an extra thread, passes a command line, and prints an exit status to the terminal. It also has some different defaults.)
* player: minor simplificationwm42015-03-051-3/+3
| | | | | argv is always terminated with a NULL, so we don't need to drag argc along. Simplifies the following commit a little bit.
* player: use symbolic constant for seek precisionwm42015-03-044-29/+43
| | | | Meh.
* input: use flag option type for some input commandswm42015-03-041-4/+11
| | | | | | | | | | This gets rid of the need for a second (or more) parameters; instead it can be all in one parameter. The (now) redundant parameter is still parsed for compatibility, though. The way the flags make each other conflict is a bit tricky: they have overlapping bits, and the option parser disallows setting already set bits.
* build: fix warnings with --disable-libasswm42015-03-041-2/+2
| | | | This crap seems to break every other fullmoon.
* audio: change playback speed directly in resamplerwm42015-03-021-10/+2
| | | | | | | | | | | | | Although the libraries we use for resampling (libavresample and libswresample) do not support changing sampelrate on the fly, this makes it easier to make sure no audio buffers are implicitly dropped. In fact, this commit adds additional code to drain the resampler explicitly. Changing speed twice without feeding audio in-between made it crash with libavresample inc ertain cases (libswresample is fine). This is probably a libavresample bug. Hopefully this will be fixed, and also I attempted to workaround the situation that crashes it. (It seems to point in direction of random memory corruption, though.)
* player: refine rar:// playlist-safety handlingwm42015-03-021-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.
* Lua: add mp.get_screen_margins().torque2015-03-011-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.
* client API: make some more properties observablewm42015-02-271-1/+2
| | | | A/V sync things.
* player: adjust A/V desync messagewm42015-02-261-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.)
* ytdl: add "--ytdl-params" optionThiago Kenji Okada2015-02-251-0/+7
| | | | | | | | | | | This option allows the user to pass non-supported options directly to youtube-dl, such as "--proxy URL", "--username USERNAME" and '--password PASSWORD". There is no sanity checking so it's possible to break things (i.e. if you pass "--version" mpv exits with random JSON error). Signed-off-by: wm4 <wm4@nowhere>
* ytdl: add --no-warningswm42015-02-241-1/+1
| | | | | | Silences "[ytdl_hook] WARNING: video doesn't have subtitles", which was an annoying and pointless message printed with almost all youtube videos.
* ytdl: Adapt to new subtitles structureJaime Marquínez Ferrándiz2015-02-241-9/+11
| | | | The requested formats can be sorted by preference and the result gives now an url or the subtitles file content
* encoding: allow encoding to channel configurations other than stereowm42015-02-231-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.)
* player: fix demuxer lifetime managementwm42015-02-222-52/+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.
* demux: add a demux_open_url() functionwm42015-02-201-9/+3
| | | | | Often stream and a demuxer are opened at the same time. Provide a function for this and replace most of its uses.
* demux: change demux_open() signaturewm42015-02-201-10/+10
| | | | Fold the relatively obscure force_format parameter into demuxer_params.
* demux: add free_demuxer_and_stream() functionwm42015-02-201-9/+4
| | | | | Although their lifetimes are conceptually different, it happens often that a demuxer is destroyed together with its stream.
* player: move timeline scanning (ordered chapters etc.) to a threadwm42015-02-201-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.)
* player: cosmetics: async/non-blocking -> reentrantwm42015-02-203-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.
* player: enable cache and demuxer thread for subtitles toowm42015-02-182-3/+7
| | | | | | | | | Includes some logic for not starting the demuxer thread for fully read subtitles. (Well, the cache will still waste _lots_ of resources, and the cache always has to be created, because we don't know whether it'll be needed _before_ opening the file.) See #1597.
* player: allow unsetting --term/osd-playing-msgwm42015-02-181-2/+2
| | | | | | Treat an empty string as unset. The fact that the option values can be NULL is merely weirdness due to how the option parser works (it unfortunately doesn't initialize string fields to non-NULL).
*