summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* osc: add alpha animation to tooltipRicardo Constantino2016-10-311-1/+14
| | | | | Fixes lingering tooltip with full alpha if mouse leaves window with OSC still active.
* player: enable no-video subtitle display on coverart toowm42016-10-312-2/+2
| | | | | | | | | | | Coverart mode has the same issue as no-video mode, except that the video chain is fully active. It shows only 1 frame at the start, which would normally mean that only the subtitle at timestamp 0 is shown. Use the no-video subtitle rendering mode in this case instead. (This still doesn't handle subtitle display when playing cover-art without audio, or playing a single image. This is because there's nothing that will advance playback_pts.)
* player: don't try updating subtitles while playback PTS doesn't progresswm42016-10-301-2/+2
| | | | | | This code would just keep it busy while e.g. being paused. Even if it's not paused, it couldn't help with anything since we obviously still lock display to the externally updated PTS.
* osc: top/bottombar: rescale layout to same size with scale=1Ricardo Constantino2016-10-291-49/+53
| | | | | Basically, there's two less values to revert to previous defaults and top/bottombar now look at scale=1 like they looked with scale=1.5.
* osc: top/bottombar: scale title if too large like boxRicardo Constantino2016-10-291-14/+24
|
* osc: compromise on default deadzonesizeRicardo Constantino2016-10-291-2/+2
| | | | | | This way people can still use the mouse to quickly check the elapsed time without moving it all the way to the bottom while still having half the screen to ignore mouse movement.
* osc: don't wrap the titleRicardo Constantino2016-10-291-1/+1
|
* osc: top/bottombar: also scale when min-width is reachedRicardo Constantino2016-10-291-12/+34
| | | | Same behavior as box/slimbox.
* osc: top/bottombar: dynamically size timecodes according to timemsRicardo Constantino2016-10-291-9/+14
|
* osc: fix missing chapter ticks with seekbarstyle=barRicardo Constantino2016-10-291-0/+1
|
* player: show subtitles on VO if --force-window is usedwm42016-10-263-1/+17
| | | | | | | | | | | | | | | | | | | | | If a VO is created, but no video is playing (i.e. --force-window is used), then until now no subtitles were shown. This is because VO subtitle display normally depends on video frame timing. If there are no video frames, there can be no subtitles. Change this and add some code to handle this situation specifically. Set a subtitle PTS manually and request VO redrawing manually, which gets the subtitles rendered somehow. This is kind of shaky. The subtitles are essentially sampled at arbitrary times (such as when new audio data is decoded and pushed to the AO, or on user interaction). To make a it slightly more consistent, force a completely arbitrary minimum FPS of 10. Other solutions (such as creating fake video) would be more intrusive or would require VO-level API changes. Fixes #3684.
* player: consistently initialize screensaver state with --force-windowwm42016-10-261-1/+1
| | | | Whether this is a good or a bad thing, make sure it's consistent.
* osc: fix crash with no chaptersRicardo Constantino2016-10-251-4/+4
| | | | Also, chapter position which wasn't changed to work with 1-based.
* command: if window-scale can't be set properly, set it as optionwm42016-10-251-13/+8
| | | | Kind of sketchy, but happens to fix #3724.
* osc: Fix and simplify limited_listMiroslav Koskar2016-10-251-28/+25
| | | | | | | | | | | * Fixes: when on the end of playlist only half of entries are displayed. * Simplifies the logic of limited_list so it's easy to follow. * limited_list's pos parameter is now 1 based which seem more natural. * Few changes to comply with code style thorough the file. * Small format change: "Playlist: (%d/%d):" -> "Playlist [%d/%d]:" "Chapters: (%d/%d):" -> "Chapters [%d/%d]:"
* osc: add script message handlers for chapter/track/playlistsRicardo Constantino2016-10-241-0/+13
| | | | | | | | | | These can be used in input.conf for pretty formatting of lists as with shift+clicking the OSC buttons. Ex: z script-message osc-playlist Z script-message osc-chapterlist x script-message osc-tracklist
* player: make --start-time work with --rebase-start-time=noAman Gupta2016-10-221-0/+3
|
* command: silence deprecation warnings with --reset-on-next-file=allwm42016-10-221-2/+11
| | | | | | | | | | | | | | | | | | | | | | --reset-on-next-file=all triggers m_config_backup_all_opts(), which backups all options (even deprecated ones). Later, when the option values are reset with m_config_restore_backups(), mp_on_set_option() is called, which in turn calls mp_property_do_silent(), which in turn will call mp_property_generic_option() and m_config_get_co(), which triggers the deprecation message. Unfortunately there's no good way to determine whether an option has actually changed (there's no option value compare operation), so the deprecated options have to be set no matter what. On the other hand, we can't pass through additional flags through the property layer. So we add a dumb global flag to silence the deprecation warnings in these cases. Fortunately m_config_get_co_raw() works to silence the warnings. m_config_get_co() also resolves aliases (deprecated and non-deprecated), but aliased options are handled differently by the option-property bridge, so we don't need to do that here, so the only purpose of it is to trigger a warning for deprecated (non-alias) options.
* command: fix reset-on-next-file=all and tv-freq optionwm42016-10-221-1/+2
| | | | | | | | The tv-freq options and properties use different types, thus must be treated as incompatible. Fixes an assertion with reset-on-next-file=all, which tries to set the option. Fixes #3708.
* player: don't leave buffering during underflowwm42016-10-211-2/+2
| | | | | | | | | | | | | | | | Don't leave the buffering state while the demuxer is still marked as having underflowed. It's unclear why this hasn't been done before - with the logic being complicated as it is, maybe there was a reason for this. This is actually still not very reliable, but should be better than what was before: on stream switching decoders can read packets all while the demuxer is executing a refresh seek, which creates the underrun situation - but nothing really totally guarantees that the underrun state remains stable when the demuxer is back at the current demuxer position. Anyway, it's an improvement. The rest of the touched condition is not changed, just moved around for cosmetic reasons.
* player: guard against MPSEEK_RELATIVE when current pts is unknownAman Gupta2016-10-211-0/+2
| | | | | | | | | | | in very rare circumstances, doing a relative seek like +1s will end up doing an absolute seek to 00:01. this guards against that possibility. so far i've only ever seen this issue when using --ad=lavc:ac3_at and doing several relative seeks in quick succession. this is likely either a bug in the audiotoolbox decoder in ffmpeg, or simply due to inherent latency in that hardware decoder which causes brief periods of time where the current audio pts is unknown.
* audio: force pts_reset only when pts jumps forward more than 5sAman Gupta2016-10-211-2/+2
| | | | | | i've seen several mpegts samples where pts jumps backwards and repeats itself. this usually happens on live tv streams from cable providers, particularly when the stream switches from one advertisement to another.
* player: speed up audio/video re-sync when there is a huge delayAman Gupta2016-10-211-1/+2
| | | | | | | | when there is a huge delay between audio/video sync, it can take a really long time to converge back. this speeds up the resync time by increasing the max_change allowed per iteration. Signed-off-by: wm4 <wm4@nowhere>
* osc: fix crash after reaching a certain position in limited listsRicardo Constantino2016-10-201-1/+1
| | | | | Don't try to display more items than there are in the chapter/playlist. Fixes #3691
* osc: use the same characters as track list for playlist/chapterRicardo Constantino2016-10-171-10/+4
| | | | | | | | | Had only tested with luajit which supports the \xHH syntax added in Lua 5.2. The arrow is troublesome to use since the ideal way to use it, as the OSD code uses it, needs \alpha&H00<arrow>\r to work, which does not in OSC's way of showing messages.
* osc: fix chapter/playlist listing if emptyRicardo Constantino2016-10-151-1/+1
|
* osc: show playlist/chapter list on prev/next instead of osdRicardo Constantino2016-10-151-4/+16
|
* osc: fix listing of chapters and playlistRicardo Constantino2016-10-151-10/+87
| | | | | | | Fixes regression since 05c398f. Add helper functions for limiting potentially huge lists of playlists and chapters and use them.
* osc: fix display of chapters and playlist scalingRicardo Constantino2016-10-151-2/+11
| | | | Compensate \fs when using non-default scale(fullscreen|windowed).
* osc: add user-alterable margin for top/bottombarRicardo Constantino2016-10-151-5/+6
|
* osc: add right-click behavior to playlist and chapter buttonsRicardo Constantino2016-10-151-0/+8
|
* osc: change default layout to bottombarRicardo Constantino2016-10-151-6/+6
| | | | | | Change a few other defaults accordingly: - seekbarstyle=bar looks better with bottombar. - Bigger scalewindowed and scalefullscreen make bottom/topbar more readable.
* ytdl_hook: Add title to playlist items if availableRicardo Constantino2016-10-151-0/+6
|
* osc: move tooltip to inside seekbar for top/bottombarRicardo Constantino2016-10-071-25/+28
| | | | Tooltip border is user-alterable
* osc: change seekbar background's alpha scalingRicardo Constantino2016-10-071-2/+4
| | | | | | This avoids a full transparent seekbar with only boxalpha=115. No change with default values.
* osc: align text vertically in top/bottombarRicardo Constantino2016-10-071-32/+39
| | | | Close #2093
* ytdl_hook: add chapters by parsing video's descriptionMaurycy Skier2016-10-061-0/+46
|
* options: handle --audio-device changes like the other optionswm42016-10-051-4/+1
| | | | | | Don't require special property code for handling updates, and simply use the UPDATE_AUDIO flag instead. Also make runtime changes to --audio-client-name take effect.
* audio: move some fallback handling to common AO reload functionwm42016-10-053-34/+36
| | | | | | | | | Now a reload requested by an AO behaves in exactly the same way as changing an AO-related options (like --audio-channels or --audio-exclusive). This is good for testing and uniform behavior. (You could go as far as saying it's a necessity, because the spotty and obscure AO reload behavior is hard to reproduce and thus hard to test at all.)
* command: flush and uninitialize audio output first on option changeswm42016-10-051-1/+3
| | | | | | | | | | | | This affects changing audio configuration options. Explicitly flush and uninitialize the audio output first before doing the rest. This should ensure all state attached to the audio output is discarded and not used during the reconfiguration. Also add a comment to the reinit_audio_filters() call. It doesn't necessarily restore the audio chain fully, but makes sure a seek is issued if the amnount of buffered audio discarded was huge enough to cause "problems".
* command: include deprecated/aliased options in property bridgewm42016-10-041-18/+28
| | | | | | | | If we really want client API users to use mpv_set_property() instead of mpv_set_option(), then compatibility handling of deprecated options should be included. Otherwise, there's the danger that client API users either break too early (and without a warning), or mpv_set_option() will continue to have a reason to exist.
* player: fix previous commitwm42016-10-032-5/+10
| | | | ...
* command: allow absolute seeks relative to end of streamPhilip Sequeira2016-10-021-0/+9
| | | | | | "seek -10 absolute" will seek to 10 seconds before the end. This more or less matches the --start option and negative seeks were otherwise useless (they just clipped to 0).
* audio: fix late audio startwm42016-10-021-1/+3
| | | | | | | | | Regression since commit bbcd0b6a. This code is just cursed, because it's a fragile state machine with no proper tests, and which could be done in a much simpler way. Without doubt this change will cause a regression in some ridiculous corner case as well. Fixes #3610 (the cause of it, not the behavior it resulted in).
* player: make --stop-screensaver runtime-changeablewm42016-10-025-8/+20
| | | | | | | | | | Move the screensaver enable/disable determination to a central place, and call it if the stop-screensaver property is changed. Also, do not stop the screensaver when in idle mode (i.e. no file is loaded). Fixes #3615.
* player: enable reading from stdin after loading input.confwm42016-09-293-7/+8
| | | | Someone requested this.
* ytdl_hook: Set aspect ratio for anamorphic videoRicardo Constantino2016-09-281-0/+6
|
* win32: make --priority runtime-settableJames Ross-Gowan2016-09-282-9/+16
| | | | | | | | | | I'm not sure if this option affects anything or if it's a placebo, especially since the VO thread is now registered with MMCSS. Still, I think --priority=high may have helped back when I used mplayer2 on a netbook. It's also possible that encoding-mode users would want to set --priority=idle. Anyway, it was one of the last M_OPT_FIXED options, so fix that.
* command: fix inverted condition in sub-reload commandwm42016-09-261-1/+1
| | | | Fixes #3586 (probably). Untested.
* player: allow opts in pseudo-gui set by the user to override user's defaultRicardo Constantino2016-09-261-2/+5
| | | | | | | | | | | | | | | | | | | | | This should still allow user-set default options to override built-in pseudo-gui while respecting user-set pseudo-gui options. Pros: - user option in default profile overrides built-in pseudo-gui's options Ex: screenshot-directory overrides built-in pseudo-gui's - user can "fix" pseudo-gui if some option like "force-window=no" is set in default by setting "force-window=yes" in [pseudo-gui] - `mpv --profile=pseudo-gui` will work as before Cons: - --show-profile=pseudo-gui won't display the built-in's options Original idea from wm4. Documentation edits mostly by wm4. Signed-off-by: wm4 <wm4@nowhere>
* video: trust demuxer framerate on invalid timestampswm42016-09-261-1/+1
| | | | | | | | | If the PTS goes backwards (whether it's a timestamp reset or some other problem) would just use 0 as frame duration. (At least until the logic for detecting divergence with the timestamps gets active.) Trust the demuxer framerate in these cases instead, if it's available. I think this improves behavior slightly with some broken files.
* scripting: don't attempt to load builtin scripts twicewm42016-09-261-1/+0
| | | | | | | | | During init it will first call mp_load_builtin_scripts(), and then again via mp_load_scripts(). This was harmless (a second attempt won't load it again if the first one was successful), but it's unnecessary, and also looks confusing if the scripts failed to load the first time.
* osc: Fix scaling issues when toggling fullscreenRicardo Constantino2016-09-251-0/+1
| | | | Fixes #3429
* lua: complain loudly if Lua state creation failswm42016-09-251-1/+3
| | | | | | | This should normally happen only if memory allocation for the state happens, which should be extremely rare. But with Luajit on OSX, it can happen if the magic compiler flags required by Luajit were not passed to mpv compilation. Print an error to reduce confusion.
* player: fix instant subtitle refresh on track switcheswm42016-09-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | When switching a subtitle track, the subtitle wasn't necessarily updated, especially when playback was paused. Some awfully subtle and complex interactions here. First off (and not so subtle), the subtitle decoder will read packets only on explicit update_subtitles() calls, which, if video is active, is called only when a new video frame is shown. (A simply video frame redraw doesn't trigger this.) So call it explicitly. But only if playback is "initialized", i.e. not when it does initial track selection and decoder init, during which no packets should be read. The second issue is that the demuxer thread simply will not read new packets just because a track was switched, especially if playback is paused. That's fine, but if a refresh seek is to be done, it really should do this. So if there's either 1. a refresh seek requested, or 2. a refresh seek ongoing, then read more packets. Note that it's entirely possible that we overflow the packet queue with this in unpredicated weird corner cases, but the queue limit will still be enforced, so this shouldn't make the situation worse.
* lua: fix array detectionwm42016-09-241-2/+2
| | | | | | | This was dumb and could return something like "{name=123}" as an array. Also, fix the error message if a key is not a string. lua_typename() takes a type directly, not a stack item.
* command: some minor corrections to previous commitwm42016-09-241-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | The last commit was fine - just making some enhancements. Rename the function to parse_node_chapters(), since it really has not much to do with Lua. Don't use len<0 as check whether it makes sense to set chapters, and instead check for mpctx->demuxer (that includes the possibility to set chapters e.g. within a preload hook, but after chapters are initialized from the demuxer). Return M_PROPERTY_ERROR instead of M_PROPERTY_OK if the mpv_node has the wrong type. It's ok if a chapter has no title, so change the checks accordingly. Remove a Yoda condition. Notify that chapter metadata might have changed with mp_notify() (the chapter list itself is already taken care by generic code). Fix leaking the metadata allocations of the new chapter list.
* command: make it possible to set chapters via lua pluginsMaurycy Skier2016-09-241-1/+70
|
* player: fix intended pseudo-gui behaviorwm42016-09-231-3/+3
| | | | It's still supposed to be possible to customize the pseudo-gui section.
* player: do not let pseudo-gui override user config settingswm42016-09-231-0/+3
| | | | | | | | Seems like this confused users quite often. Instead of --profile=pseudo-gui, --player-operation-mode=pseudo-gui now has to be used to invoke pseudo GUI mode. The old way still works, and still behaves in the old way.
* m_config, command: remove some minor code duplicationwm42016-09-231-3/+2
| | | | | | I would have been fine with this, but now I want to add another flag, and the duplication would become more messy than having a strange function for deduplication.
* command: make most options observablewm42016-09-231-0/+6
| | | | | | | | | | | The property observation mechanism turns properties into integer IDs for fast comparison. This means if two properties get the same ID, they will receive the same notifications. Use this to make properties under options/ receive notifications. The option-property bridge marks top-level properties with the same name as the options. This still might not work in cases the C code sets values on options structs directly.
* command: fix potential UBwm42016-09-231-5/+5
| | | | Pointed out by quilloss on github.
* x11: fix external fullscreen updatewm42016-09-231-0/+9
| | | | | | | | | | | | On x11, you can change the fullscreen via the window manager and without mpv's involvement. In these cases, the internal fullscreen flag has to be updated. The hack used for this didn't really work properly. Change it accordingly. The important thing is that the shadow copy of the option is updated. This is still not really ideal. Fixes #3570.
* player: make audio-channels etc. runtime settablewm42016-09-221-0/+7
| | | | | | | | | If one of the audio output format options is set, brually reinit the audio chain. Since the audio-channels property is still mapped to the deprecated read-only property,