summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* core: add playback resume feature (manual/opt-in)wm42013-05-0510-1/+155
| | | | | | | | | | | | | | | | | | | | | | | | | A "watch later" command is now mapped to Shift+Q. This quits the player and stores the playback state in a config file in ~/.mpv/watch_later/. When calling the player with the same file again, playback is resumed at that time position. It's also possible to make mpv save playback state always on quit with the --save-position-on-quit option. Likewise, resuming can be disabled with the --no-resume-playback option. This also attempts to save some playback parameters, like fullscreen state or track selection. This will unconditionally override config settings and command line options (which is probably not what you would expect, but in general nobody will really care about this). Some things are not backed up, because that would cause various problems. Additional subtitle files, video filters, etc. are not stored because that would be too hard and fragile. Volume/mute state are not stored because it would mess up if the system mixer is used, or if the system mixer was readjusted in the meantime. Basically, the tradeoff between perfect state restoration and complexity/fragility makes it not worth to attempt to implement it perfectly, even if the result is a little bit inconsistent.
* command: alias video/audio/sub properties to -vid/-aid/-sidwm42013-05-051-9/+26
| | | | | | | | | Now vid/aid/sid can be used as properties. video/audio/sub still work, but they are aliases for the "real" properties. This guarantees that options/properties use the same value range. One consequence is that the video/audio/sub properties return "no" as value if no track is selected instead of -1.
* mplayer: factor config dir creationwm42013-05-051-18/+23
| | | | Move it into its own function.
* core: ignore backstep command if demuxer is not capablewm42013-05-051-4/+7
| | | | | | Also, mark demuxer as not capable if DVD playback is done. The problem with DVD is that playback time (stream_pts) is not reported frame-exact, and the time is a "guess" at best.
* options: correctly handle things like: dvd://1-2/filenamewm42013-05-051-7/+9
| | | | | The "/filename" part was silently dropped when a range of titles is specified.
* core: move demuxer time reporting to demuxerwm42013-05-051-8/+4
|
* video: add --hwdec-codecs option to whitelist codecs for hw decodingwm42013-05-043-0/+4
|
* video: support YCgCo colorspacewm42013-05-041-1/+2
| | | | | | | YCgCo can be manually selected, but will also be used if the decoder reports YCgCo. To make things more fun, files are sometimes marked incorrectly, which will display such broken files incorrectly starting with this commit.
* stream_bluray: remove the broken -bluray-chapter optionreimar2013-04-271-1/+0
| | | | | | | | | | Remove the broken -bluray-chapter option. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36175 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: DOCS/man/en/mplayer.1 cfg-common.h
* mplayer: put space before encoding part of status linewm42013-04-271-1/+1
| | | | Also, the trailing space isn't needed.
* options: allow using [ ] for quoting in sub-optionswm42013-04-261-1/+8
| | | | | | This is an attempt to make quoting of sub-option values less awkward, even if it works only with some shells. This is needed mainly for vf_lavfi. Also update the vf_lavfi manpage section.
* core: simplify handling of --pausewm42013-04-255-31/+21
| | | | | | | | | | | | | Rename the struct MPOpts "start_pause" field to "pause". Store the user- pause state in that field, so that both runtime pause toggling and the --pause switch change the same variable. Simplify the initialization of pause so that using --pause and changing the file while paused is exactly the same case (changing the file while paused doesn't unpause, this has been always this way). Also make it a bit more consistent. Before, starting with --pause would reset the pause state for every file, instead of following the usual semantics for option switches (compare with behavior of --fs).
* core: don't let cache pause handling and user pausing conflictwm42013-04-253-10/+25
| | | | | | | | | | | | The core pauses and unpauses automatically to wait for the network cache (also known as buffering). This conflicted with user pause control, and was perceived as if the player was unresponsive and/or the cache just overturned the user's decisions. Change it so that the actual pause state and the pause state as intended by the user never conflict. If the user toggles pause, the pause state will be in the expected state as soon as the cache is loaded.
* core: fix bogus condition that broke backstepping with last commitwm42013-04-251-1/+1
| | | | | This broke all cases where indexing was required, and the current frame wasn't the first frame in a segment.
* core: fix backstepping with ordered chapterswm42013-04-251-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | There were two problems. First, frames past the end of the current segment were added to the index, which messed up backstepping. Check for the endpts before added a frame to the index. Second, it wasn't possible to step over segments which change the file. Changing a file causes decoder reinitialization, which (rightfully) is treated as discontinuity (and vo_pts_history_seek_ts was changed). Add some extra code to pretend that a segment-switching seek/reinit does not introduce discontinuities. There's still a weird corner case: sometimes, you can frame step forward on the last frame of a segment without reaching the next segment immediately. This is because the playloop switches into audio-only mode. The segment is switched when both audio and video have ended, so the frame stepping will play random sized chunks of audio until the segment will be switched. This gives the impression that backstepping doesn't work perfectly, even though it's the other way around and frame stepping behaves weird. This is a consequence of wanting to make frame stepping work with audio, and is not really a bug.
* core: add backstep supportwm42013-04-245-8/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows stepping back one frame via the frame_back_step inout command, bound to "," by default. This uses the precise seeking facility, and a perfect frame index built on the fly. The index is built during playback and precise seeking, and contains (as of this commit) the last 100 displayed or skipped frames. This index is used to find the PTS of the previous frame, which is then used as target for a precise seek. If no PTS is found, the core attempts to do a seek before the current frame, and skip decoded frames until the current frame is reached; this will create a sufficient index and the normal backstep algorithm can be applied. This can be rather slow. The worst case for backstepping is about the same as the worst case for precise seeking if the previous frame can be deduced from the index. If not, the worst case will be twice as slow. There's also some minor danger that the index is incorrect in case framedropping is involved. For framedropping due to --framedrop, this problem is ignored (use of --framedrop is discouraged anyway). For framedropping during precise seeking (done to make it faster), we try to not add frames to the index that are produced when this can happen. I'm not sure how well that works (or if the logic is sane), and it's sure to break with some video filters. In the worst case, backstepping might silently skip frames if you backstep after a user-initiated precise seek. (Precise seeks to do indexing are not affected.) Likewise, video filters that somehow change timing of frames and do not do this in a deterministic way (i.e. if you seek to a position, frames with different timings are produced than when the position is reached during normal playback) will make backstepping silently jump to the wrong frame. Enabling/disabling filters during playback (like for example deinterlacing) will have similar bad effects.
* mplayer: apply hrseek framedrop only when doing hrseekwm42013-04-241-2/+2
| | | | | | | | | | It's not sure if there's anything that could trigger this accidentally. Normally this can't happen, because hrseek ends always if the PTS is large enough, the same condition which disables framedrop. Seeking resets hrseek framedrop anyway. On the other hand, this change makes the code easier to understand, and might be more robust against weird corner cases.
* x11: use mpv internal key auto-repeat handling if possiblewm42013-04-242-0/+2
| | | | | | | | | | | | | | | | | Block X11's native key repeat, and use mpv's key repeat handling in input.c instead. No configure check for XKB. Even though it's an extension, it has been part of most (all?) xlibs since 1996. If XKB appears to be missing, just refuse enabling x11. This is a potentially controversial change. mpv will use its own key repeat rate, instead of X11's. This should be better, because seeking will have a standardized "speed" (seek events per seconds when keeping a seek key held down). It will also allow disabling key repears for certain commands, though this is not done anywhere yet. The new behavior can be disabled with the --native-keyrepeat option.
* input: don't reset time on each key repeatwm42013-04-241-2/+4
| | | | | | Key repeats were skipped when playloop iterations took too long. Fix this by using the total times for key repeat calculation, instead of the time difference to the last key repeat event.
* input: adjust wait time for key-repeatwm42013-04-241-0/+4
| | | | | Basically, these are additional timers that can expire without making the central select() exit.
* input: change default auto-repeat settingswm42013-04-241-2/+2
| | | | Rather arbitrary, but reasonable.
* input: don't let multi-key bindings block simple key bindingswm42013-04-241-4/+16
| | | | | | | | | | | | | Key bindings can include mutiple keys at once (additional to key modifiers like ctrl etc.). This becomes annoying when quickly switching between two bound keys, e.g. when seeking back and forth, you might end up hitting the "left" and "right" keys at once. The user doesn't expect to invoke the key binding "left-right", but would prefer a key stroke to invoke the binding it was supposed to invoke. So if there's no binding for a multi-key combination, try to find a binding for the key last held down. This preserves the ability to define multi-key combinations, while the common case works as expected.
* input: reduce amount of tracked keys per bindingwm42013-04-241-1/+1
| | | | | There's no need for key bindings that consist of 32 keys held down. It's ridiculous and wastes memory.
* input: fix handling of MP_KEY_STATE_DOWNwm42013-04-242-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | VOs can use the MP_KEY_STATE_DOWN modifier to pass key up/down events to input.c, instead of just simple key presses. This allows doing key auto- repeat handling in input.c, if the VO doesn't want to do that. One issue is that so far, this code has been used only for mouse events, even though the code was originally written with keyboard keys in mind. One difference between mouse keys and keyboard keys is that the initial key down should not generate an input command with mouse buttons (input.c did that), while keyboard events should (input.c didn't do that). Likewise, releasing a key should generate input commands for mouse buttons releases, but not for the keyboard. Change the code so mouse buttons (recognized via the MP_NO_REPEAT_KEY flag) follow the old hehavior, while other keys generate input commands on key down, but not on key release. Note that a key release event is posted either using MP_INPUT_RELEASE_ALL, or a normal key press event after having sent a an event with MP_KEY_STATE_DOWN. This is probably a bit confusing, and a MP_KEY_STATE_RELEASE should be added. Fix shift-handling with MP_KEY_STATE_DOWN as well.
* m_option: fix positional sub-option skippingwm42013-04-231-2/+2
| | | | | | Empty sub-option parameters mean the sub-option should be skipped, e.g. -vf gradfun=:10 sets the second option (by position) to 10. This was broken in commit 04f1e2d.
* m_option: allow quoted positional parameters for -vfwm42013-04-231-36/+53
| | | | | | | | | This allows things like: '--vf=lavfi="gradfun=20:30"' Adjust the documentation for vf_lavfi to make the example less verbose. As an unrelated change, add a general description to vf_lavfi.
* vf_lavfi: add libavfilter bridgewm42013-04-211-0/+7
| | | | | | | | | | | | | | | | | Requires recent FFmpeg/Libav git versions. Earlier versions will not be supported, as the API is different. (A libavfilter version that uses AVFrame instead of AVFilterBuffer is needed.) Note that this is sort of useless, because the option parser prevents you from making use of the full libavfilter graph syntax. This has to be fixed later. Most of the filter creation code (half of the config() function) has been taken from avplay.c. This code is not based on MPlayer's vf_lavfi. The MPlayer code doesn't compile as it hasn't been updated through multiple libavfilter API changes, making it completely useless as a starting point.
* m_option: redo code for parsing -vf to accept quoteswm42013-04-211-130/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parsing sub-configs (like --rawvideo=subopts or the suboptions for --vo=opengl:subopts) was completely different from the -vf parsing code for a variety of reasons. This change at least makes -vf use the same splitter code as sub-config options. The main improvement is that -vf now accepts quotes, so you can write things like: -vf 'lavfi=graph="gradfun=10:20"' (The '' quotes are for shell escaping.) This is a rather big and intrusive change. Trying some -vf lines from etc/encoding-example-profiles.conf seems to confirm it still works. This also attempts to unify one subtle difference in handling of positional arguments. One consequence is that a minor detail changes. Sub-configs don't know positional arguments, and something like "-- opt=sub1=val1:sub2" means that sub2 has to be a flag option. In -vf parsing, sub2 would be a positional option value. To remove this conflict and to facilitate actual unification of the parsers in the future, the sub2 will be considered a flag option if and only if such a flag option exists. Otherwise, it's considered a value for a positional option. E.g. if there's a filter "foo" with a string option "sopt" and a flag option "fopt", the behavior of the following changes: -vf foo=fopt Before this commit, this would set "sopt=fopt" in the filter. Now, it enables the fopt flag, and the sopt option remains unset. This is not an actual problem to my knowledge.
* m_option: add function to check whether parameters are requiredwm42013-04-213-4/+11
| | | | To avoid that it will be duplicated with m_option.c and m_config.c.
* options: untangle track range parsing for stream_cddawm42013-04-212-72/+1
| | | | | | | | | Remove the "object settings" based track range parsing (needed by stream_cdda only), and make stream_cdda use CONF_TYPE_INT_PAIR. This makes the -vf parsing code completely independent from other options. A bit of that code was used by the mechanism removed with this commit.
* m_option: split out sub-config parsingwm42013-04-211-37/+54
|
* bstr: add bstrto0()wm42013-04-211-0/+6
|
* bstr: add bstrspn()wm42013-04-212-0/+10
|
* mplayer: prefer -sub/-subfile subs over auto-loaded subswm42013-04-202-2/+9
| | | | | | | | | Before this commit, it was more or less random which subtitle was preferred if there was both an auto-loaded external subtitle, and a subtitle loaded via -sub or -subfile. -sub subtitles happened to be preferred over auto-loaded subs, while -subfile didn't. Fix the -subfile case, and make the behavior consistent by making the selection behavior explicit.
* core: display subtitle codec in track listingwm42013-04-201-2/+9
| | | | | Also switch the subrip and subviewer names, which obviously have been confused.
* demux: remove some unused sh_video_t fieldswm42013-04-201-5/+0
| | | | Completely mysterious, and its values were never actually used.
* sub, demux: identify subtitle types with the codec namewm42013-04-201-8/+6
| | | | | | | | | Get rid of the 1-char subtitle type field. Use sh_stream->codec instead just like audio and video do. Use codec names as defined by libavcodec for simplicity, even if they're somewhat verbose and annoying. Note that ffmpeg might switch to "ass" as codec name for ASS, so we don't bother with the current silly "ssa" name.
* av_common: allow calling mp_codec_to_av_codec_id() with NULLwm42013-04-201-7/+9
| | | | Helps reducing special cases.
* command: try to switch subs too for program propertywm42013-04-201-2/+4
| | | | Untested, but why not.
* core: matroska: support concatenated segmentswm42013-04-201-43/+80
| | | | | | | | | | | | | | | | | | | | | Matroska files can contain multiple segments, which are literally further Matroska files appended to the main file. They can be referenced by segment linking. While this is an extraordinarily useless and dumb feature, we support it for the hell of it. This is implemented by adding a further demuxer parameter for skipping segments. When scanning for linked segments, each file is opened multiple times, until there are no further segments found. Each segment will have a separate demuxer instance (with a separate file handle etc.). It appears the Matroska spec. has an even worse feature for segments: live streaming can completely reconfigure the stream by starting a new segment. We won't add support for it, because there are 0 people on this earth who think Matroska life streaming is a good idea. (As opposed to serving Matroska/WebM files via HTTP.)
* mplayer: take tracks from first segment if main file is emptywm42013-04-201-3/+9
| | | | | | | | | | | With Matroska ordered chapters, the main file (i.e. the file you're playing) can be empty, while all video/audio data is in linked files. Some files don't even contain the track list, only chapter information. mpv refused to play these, because normally, the main file dictates the track layout. Fix this by using the first segment for track data if no part of the timeline is sourced from the main file.
* encoding: when output is pipe: or pipe:1, avoid mp_msg to stdoutRudolf Polzer2013-04-153-1/+11
| | | | | | | | | I am aware this detection may occur too late, depending on other settings, but at least it usually works and is portable. Where the output fd can be changed, though, it'd be better to force a similar behaviour via file descriptor use: use pipe:3 as output to FD 3, and change the calling program to expect the stream on FD 3.
* core: remove dead --vsync leftoverswm42013-04-122-11/+1
|
* command: fix deref before NULL checkwm42013-04-121-1/+1
| | | | Was accidentally broken in the last global variable removal round.
* mplayer: remove unnecessary variablewm42013-04-102-8/+4
|
* core: add --reset-on-next-file optionwm42013-04-105-0/+32
| | | | | | | This option can be used to selectively reset settings when playing the next file in the playlist (i.e. restore mplayer and mplayer2 behavior). Might remove this option again should it turn out that nobody uses it.
* mplayer: keep volume persistent, even when using --volumewm42013-04-101-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider: mpv --volume 10 file1.mkv file2.mkv Before this commit, the volume was reset to 10 when playing file2.mkv. This was inconsistent to most other options. E.g. --brightness is a rather similar case. In general, settings should never be reset when playing the next file, unless the option was explicitly marked file-local. This commit corrects the behavior of the --volume and --mute options. File local --volume still works as expected: mpv --{ --volume 10 file1.mkv file2.mkv --} This sets the volume always to 10 on playback start. Move the m_config_leave_file_local() call down so that the mixer code in uninit_player() can set the option volume and mute variables without overwriting the global option values. Another subtle issue is that we don't want to set volume if there's no need to, which is why the user_set_volume/mute fields are introduced. This is important because setting the volume might change the system volume depending on other options.
* mplayer: move DVB channel skip codewm42013-04-101-23/+21
| | | | Try not to cause unnecessary special cases.
* mplayer: don't disable term-osd with -vwm42013-04-101-4/+0
| | | | I don't see any reason for doing this.
* command: fix loadlist commandwm42013-04-101-3/+5
| | | | | | | A simple inverted condition prevented it from working properly. Also, make sure that playlist is played from beginning when the playlist is replaced.
* mplayer: don't print bogus status when cachingwm42013-04-101-1/+1
| | | | | When streaming from http, this could print a status line indicating paused playback instead of "buffering" sometimes.
* core: remove volstep global variablewm42013-04-094-5/+4
|
* core: restore --mc default value (fixes A/V sync)wm42013-04-091-0/+1
| | | | | | | | | | | Commit bc20f2c moved the variable default_max_pts_correction (which backs the --mc option) to the MPOpts struct. The initializer was forgotten when doing this, so it was left at 0. This disabled part of the A/V sync mechanism. This was apparent when using ad_spdif (this decoder has other A/V sync related problems, and thus triggers this issue easily). Closes #59.
* Remove some apple remote leftoverswm42013-04-053-26/+0
| | | | The options and key names don't do anything anymore.
* input: remove ar.h includeStefano Pigozzi2013-04-051-2/+0
| | | | This is a left over from c8fd9e50e47.
* demux_mkv: try to show current subtitle when seekingwm42013-04-043-0/+4
| | | | | | | | | | | | | | | | | Makes sure that seeking to a given time position shows the subtitle at that position. This can fail if the subtitle packet is not close enough to the seek target. Always enabled for hr-seeks, and can be manually enabled for normal seeks with --mkv-subtitle-preroll. This helps displaying subtitles correctly with ordered chapters. When switching ordered chapter segments, a seek is performed. If the subtitle is timed slightl