summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* video: do not use MP_NOPTS_VALUE for A/V differencewm42015-05-243-7/+3
| | | | | | There's no need for this, it just creates more corner cases. Also always reset it on seeks etc..
* player: add function to compute past frame durationswm42015-05-243-17/+28
| | | | | And use it for the estimated-vf-fps property (it should be doing the same as before).
* command: add protocol-list propertywm42015-05-231-0/+16
| | | | Fixes #1972.
* ytdl: do not use deprecated optionwm42015-05-231-1/+1
| | | | This was missed in commit 450af053.
* command: allow changing track properties while no file is loadedwm42015-05-221-16/+20
| | | | | | | | | | Now it simply changes the options, i.e. what will be requested, instead of returning M_PROPERTY_UNAVAILABLE. This is another minor step towards unifying options and properties. Still a bit weird: it will always return "no" if no file is loaded, and disregards the option value.
* player: use an array for stream ID options and suchwm42015-05-223-37/+25
| | | | This makes the code slightly more generic.
* command: deprecate audio-sampleratewm42015-05-221-43/+2
| | | | | | | Also replace their implementation with the recently introduced properties. One significant difference is that audio-channels using OSD formatting does not print the channel layout. The user can just use the replacement property instead.
* command: add audio-params and audio-out-params propertieswm42015-05-221-1/+40
|
* command: rename audio-format propertywm42015-05-221-4/+6
| | | | Clashes with the option.
* options: rename --media-title optionwm42015-05-221-1/+1
| | | | Conflicts with the property.
* command: deprecate the "length" propertywm42015-05-222-9/+9
| | | | It collides with the --length option.
* command: add a new property deprecation mechanismwm42015-05-221-0/+29
| | | | Looks like this will be needed a lot...
* audio: change range of volume option/propertywm42015-05-221-2/+2
| | | | | | | | | Now --volume takes an absolute volume, meaning it doesn't depend on --softvol-max. 0 is still silence, and 100 now always means unchanged volume. The OSD and the "volume" property are changed accordingly. Also raise the minimum value of --softvol-max. A value below 100 makes no sense and breaks the OSD.
* command: explicitly show mouse cursor when unfullscreeningwm42015-05-211-2/+6
|
* command: refactor if/else statements to switchRobin2015-05-201-11/+19
| | | | | | The code checking for the type of seeking contained some if else statements. To improve readability, I decided to refactor those statements to a switch statement.
* video: force audio resync after video discontinuitywm42015-05-201-0/+1
|
* video: better heuristic for timestamp resetswm42015-05-201-2/+13
| | | | | | | | | | | | | | | Reduce the default tolerance for timestamp jumps from 60 to 15 seconds. For .ts files, where ts_resets_possible coming from AVFMT_TS_DISCONT is set, apply a more sophisticated heuristic. It's clear that such a file wouldn't have a framerate below, say, 23hz. If the demuxer reports a lower fps, we allow longer PTS jumps. This should replace long pauses on discontinuities with .ts files with at most a short stutter. Of course, all kinds of things could go wrong anyway if the source is VFR, or FFmpeg's frame rate detection fails in some other way. I haven't found such a file yet, though.
* audio: fix resync issue differentwm42015-05-191-1/+3
| | | | | | | | | | | Commit 10915000 attempted to fix wasting CPU when resyncing and no new data was actually coming from the demuxer. The fix assumed that at this point it would have reached the sync point, but since the code attempts weird incremental decoding, this wasn't actually true. So it broke seeking in addition to removing the CPU waste. Try something else. This time, we essentially only wakeup again if data was read (i.e. audio_decode() returned successfully).
* command: change OSD symbol for absolute perc. seekrrooij2015-05-191-2/+4
| | | | | | | | | | The OSD symbol for seeking to an absolute percentage was always OSD_FFW, even when it should be OSD_REW. It uses the correct OSD symbols now, by checking the current position ratio. Note: The symbol is still incorrectly given when the absolute percentage is very close to the current position ratio. Fortunately, that's a rare use case.
* audio: avoid wasting CPU due to continuous wakeupwm42015-05-191-1/+2
| | | | | | | | | Thsi code path happens during seeking. If video is still being decoded to get to the first video frame, audio has nothing to do, as it is synchronized against the first video frame. We only want to wake up if there's an actual state change. Fixes #1958.
* command: use consistent comment stylerrooij2015-05-191-1/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* input: add relative percentage seekrrooij2015-05-191-0/+5
| | | | | | | | | | | Only absolute percentage seeking was permitted first. It is now also possible to seek by relative percentage. MPSEEK_FACTOR is used as seek_type. Fixes #1950. Signed-off-by: wm4 <wm4@nowhere>
* command: add playlist_shuffle commandwm42015-05-171-0/+5
| | | | Fixes #965.
* threads: use utility+POSIX functions instead of weird wrapperswm42015-05-111-2/+4
| | | | | | | There is not much of a reason to have these wrappers around. Use POSIX standard functions directly, and use a separate utility function to take care of the timespec calculations. (Course POSIX for using this weird format for time values.)
* Always block SIGPIPE globallywm42015-05-111-0/+7
| | | | | | | | | | | | | | | OpenSSL and GnuTLS are still causing this problem (although FFmpeg could be blamed as well - but not really). In particular, it was happening to libmpv users and in cases the pseudo-gui profile is used. This was because all signal handling is in the terminal code, so if terminal is disabled, it won't be set. This was obviously a questionable shortcut. Avoid further problems by always blocking the signal. This is done even for libmpv, despite our policy of not messing with global state. Explicitly document this in the libmpv docs. It turns out that a version bump to 1.17 was forgotten for the addition of MPV_FORMAT_BYTE_ARRAY, so document that change as part of 1.16.
* ytdl_hook: remove tabswm42015-05-091-5/+5
| | | | We don't allow tabs in normal source code.
* player: reuse a functionwm42015-05-091-5/+1
| | | | | This has the side-effect that now all encoding-profiles.conf files are loaded. It's not clear if not doing this was intended or not.
* player: make resuming playlists less noisy in verbose modewm42015-05-093-15/+16
| | | | | | | | | | | | | | | | | | | mp_find_config_file() will print the filename lookup and its result in verbose mode. This is wanted, but gets inconvenient when it is done for every playlist entry (for resuming). Lookup the watch_later subdir only once and cache the result instead. This drops the logic for loading the resume file from other locations, which should generally be unnecessary, though might lead to confusion if the user has mixed old and new config paths (which the user shouldn't). Also add a mp_find_user_config_file() function for a more straightforward and reliable way to get actual local configpaths, instead of possibly global and unwritable locations. Also, for symmetry, check the resume option in mp_load_playback_resume() just like mp_check_playlist_resume() does.
* player: avoid undefined behavior when resumign DVD/BD playbackwm42015-05-091-3/+3
| | | | These device options can be NULL, and NULL can't be passed for %s.
* path: make mp_path_join accept normal C stringswm42015-05-094-6/+6
| | | | | Instead of bstr. Most callers of this function do not need bstr. The bstr version of this function is now mp_path_join_bstr().
* lua: remove deprecated "lua" sub directorieswm42015-05-092-29/+9
| | | | | The compatibility code and the deprecation warning were at least in releases 0.8 and 0.9 - time to get rid of them.
* player: add --force-window=immediate modewm42015-05-081-0/+2
| | | | | | | This creates the window before the first file is loaded. This was requested a bunch of times, but on the other hand a change to make this behavior the default was reverted some time ago, because other users hated it.
* player: use profiles for libmpv and encoding defaultswm42015-05-072-24/+32
| | | | | | | | The client API (libmpv) and encoding (--o) have slightly different defaults from the command line player. Instead of doing a bunch of calls to set the options explicitly, use profiles. This is simpler and has the advantage that they can be listed on command line (instead of possibly forcing the user to find and read the code to know all the details).
* m_config: make m_config_set_profile() use a namewm42015-05-071-2/+2
| | | | Is simpler and avoids exposing profile structs to a degree.
* ytdl_hook: Escape EDL URLsChrisK22015-05-071-1/+3
| | | | | Should prevent the EDL parser from tripping over = and , in the URL.
* path: start special espansion with ~~name instead of ~namewm42015-05-031-1/+1
| | | | | | | Since commit 7381db60, strings like "~desktop/" were expanded as platform-specific paths by mpv. Apparently this similarity to standard Unix shell expansion caused confusion, so change it to "~~desktop/". The shell doesn't expand this, so it should be better.
* options: fix typo in variable namewm42015-05-031-1/+1
|
* options: remove --leak-reportwm42015-05-021-11/+3
| | | | Use the environment variable instead.
* win32: move platform specifics to osdepwm42015-05-021-25/+0
| | | | | This will probably disable this code for Cygwin. I don't know if this matters, since Cygwin should strictly behave like a Unix anyway.
* build: move main-fn files to osdepwm42015-05-024-71/+1
| | | | | | And split the Cocoa and Unix cases. Simplify the Cocoa case slightly by calling mpv_main directly, instead of passing a function pointer. Also add a comment explaining why Cocoa needs a special case at all.
* cocoa: always compile OSX application code with cocoawm42015-05-021-2/+2
| | | | | | | | | | | | | | This unbreaks compiling command line player and libmpv at the same time. The problem was that doing so silently disabled the OSX application thing - but the command line player can not use the vo_opengl Cocoa backend without it. The OSX application code is basically dead in libmpv, but it's not that much code anyway. If you want a mpv binary that does not create an OSX application singleton (and creates a menu etc.), you must disable cocoa completely, as cocoa can't be used anyway in this case.
* player: handle hotplug events in idle mode toowm42015-05-021-0/+1
|
* screenshots: create screenshot dirwm42015-05-021-0/+2
| | | | Minor user convenience.
* screenshots: change default directory in pseudo-gui mode to desktopwm42015-05-011-1/+2
| | | | | | | | This should take care of the endless complaints about the default location for screenshots (and will of course create new ones). If the screenshot-template is set to an absolute path, the directory won't be used. So this should be reasonably compatible.
* screenshots: add --screenshot-directory optionwm42015-05-011-0/+8
| | | | | The plan is to use this to change the screenshot default location in pseudo-gui mode.
* player: properly destroy client context if thread can't be createdwm42015-04-301-1/+4
| | | | Minor leak in an obscure out of memory case.
* command: let sub_reload remove the old track firstwm42015-04-281-8/+10
| | | | | | In the most simple case, this prevents the track ID from changing. One disadvantage is that if the file fails loading, the track is gone for good and would have to be re-added explicitly by the user.
* player: log track list when adding or removing external fileswm42015-04-283-5/+16
| | | | | | | | | Should help with debugging, and might be slightly more userfriendly. Note that this is called manually in multiple entry-points, instead of the functions doing the actual work (like mp_remove_track()). This is done so that exiting the player or calling the sub_reload command won't print redundant in-between states.
* player: clamp display time to known time range on seekingwm42015-04-281-0/+7
| | | | | | | | | | | | | | | During seeking, and there is momemtarily no new data available yet, the player will display the seek target as current time. Clamp this time to the known time range as implied by the start time and the duration of the file. This improves behavior especially when seeking in audio files, for which this for some reason triggers rather often. There were some users complaining about this. This makes behavior worse for files with timestamp resets, or incorrectly reported duration. (The latter is relatively common, e.g. libavformat shortcomings, or incomplete files.)
* osc: redo slider position translationChrisK22015-04-281-33/+55
| | | | | | Now done in one place instead of mulitple times all over the code. Fixes #1876
* ytdl_hook.lua: Change format options when vid is "off"robin2015-04-271-6/+7
| | | | | | | | This will change the format option to "bestaudio/best" instead of passing the "-x" argument to yt-dl. Prevents the video still being downloaded in the new mpv versions where the yt-dl format is set to "best" by default.
* player: fix removing external tracks at runtimewm42015-04-271-1/+9
| | | | | | | | | | This could make the player crash on exit if the "sub_reload" command was used successfully. the reason was that the mpctx->sources array could have dangling pointers to the unloaded demuxers. Also fix a memory leak by actually always freeing the per-stream subtitle decoders (which are a hack to make ordered chapters behave better).
* player: flush decoder even if cover art is decodedwm42015-04-241-1/+1
| | | | | | | | | | | | | | | Fixes PNG cover art not showing up immediately (for example when running with --pause). libavformat exports embedded cover art as a single packet. For example, a PNG attachment simply contains the PNG image, which can be sent to the decoder. Normally you would expect that the PNG decoder would return 1 frame for 1 packet, without any delays. But this stopped working, and it incurs a 1 frame delay. This is perfectly legal (even if unexpected), so let our code feed the decoder packets until we get something back. (In theory feeding the packet instead of a real flush packet is still somewhat questionable.)
* player: don't show A/V desync message in non-sense situationswm42015-04-241-2/+2
| | | | | | | last_av_difference can be MP_NOPTS_VALUE under certain circumstances (like no video timestamp yet). This triggered the desync message, because fabs(MP_NOPTS_VALUE) is quite a large value. We don't want to show a message in this situation.
* osc: add nil check for element.eventresponderwm42015-04-231-1/+1
| | | | Possibly fixes a crash (see #1101).
* demux_mkv: move global options to the demuxerwm42015-04-231-2/+0
| | | | | | | The options don't change, but they're now declared and used privately by demux_mkv.c. This also brings with it a minor refactor of the subpreroll seek handling - merge the code from playloop.c into demux_mkv.c. The change in demux.c is pretty much equivalent as well.
* lua: add utils.format_json() functionwm42015-04-221-0/+18
| | | | Requested. Why not.
* osc: paint over a crashwm42015-04-221-4/+6
| | | | | Sometimes tries to index a nil object when seeking close to the end of the file. See #1101.
* player: do not load encoding config files in non-encoding modewm42015-04-211-8/+6
| | | | | | | | It's annoying and unnecessary. They can be manually loaded if really needed (for things like previewing). Also remove the #if. It was for suppressing warnings, and we don't need to be so careful about this in the relatively obscure encoding mode.
* command: demuxer-cache-time propertyxylosper2015-04-211-1/+21
| | | | | | | | Approximate time of video buffered in the demuxer, in seconds. Same as `demuxer-cache-duration` but returns the last timestamp of bufferred data in demuxer. Signed-off-by: wm4 <wm4@nowhere>
* player: cleanup update_fps() functionwm42015-04-202-13/+5
| | | | | It was called only in 2 places, one of them redundant (the container FPS can not change).
* video: cleanup some old log messageswm42015-04-201-0/+2
| | | | | These are basically MPlayer leftovers, and barely useful due to being redundant with other messages. The FPS message is used somewhere else.
* client API: add a screenshot_raw commandwm42015-04-203-0/+52
| | | | | | | | | Requested. The wild code for setting up the mpv_node probably deserves to be cleaned up later. Fixes #1800.
* client API: add MPV_FORMAT_BYTE_ARRAY typewm42015-04-201-0/+3
| | | | | | | | | | | | This will be used in the following commit, which adds screenshot_raw. The reasoning is that this will be better for binding scripting languages. One could special-case the screenshot_raw commit and define fixed semantics for passing through a pointer using the current API, like formatting a pointer as string. But that would be ridiculous and unclean.
* client API: add glue for making full use of mpv_command_node()wm42015-04-204-10/+14
| | | | | Until now, the return value was always MPV_FORMAT_NONE. Now a command can actually set it. This will be used in one of the following commits.
* player: change video-bitrate and audio-bitrate propertieswm42015-04-201-47/+28
| | | | | | | | | | | | | | Remove the old implementation for these properties. It was never very good, often returned very innaccurate values or just 0, and was static even if the source was variable bitrate. Replace it with the implementation of "packet-video-bitrate". Mark the "packet-..." properties as deprecated. (The effective difference is different formatting, and returning the raw value in bits instead of kilobits.) Also extend the documentation a little. It appears at least some decoders (sipr?) need the AVCodecContext.bit_rate field set, so this one is still passed through.
* command: disc-mouse-on-button propertyxylosper2015-04-213-0/+33
| | | | | This property indicates whether mouse cursor is located on button or not for disc naviation.
* vf_screenshot: remove this filterwm42015-04-161-6/+1
| | | | | | It's entirely useless, especially now that vo.c handles screenshots in a generic way, and requires no special VO support. There are some potential weird use-cases, but actually I've never seen it being used.
* command: let screenshot_to_file command overwrite fileswm42015-04-161-5/+0
|