summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* 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 slightly before the start of the segment, it normally won't be demuxed. This is a problem with all seeks, but in this case normal playback is affected. Since switching segments always uses hr-seeks, the code added by this commit is always active in this situation. If no subtitles are selected or the subtitles come from an external file, the demuxer should behave exactly as before this commit.
* options: fix --no-colorkeywm42013-04-041-1/+1
| | | | | | | In the last cleanup round, this was accidentally changed from a store option to int, and the option value was passed as flag value. (Not that anyone needs/uses/cares about this option...)
* core: add --heartbeat-interval optionwm42013-04-045-3/+8
| | | | | | This closely follows MPlayer commit 36099, with some changes. Move a mutable static variable into MPContext.
* av_common: minor simplificationwm42013-04-041-8/+2
|
* command: silence "Audio: no audio" line for playback speedwm42013-04-041-1/+2
| | | | | If no audio stream is selected, this line will be printed by reinit_audio_chain() when changing playback speed.
* mplayer: switch back to video PTS for reporting playback timewm42013-04-042-10/+8
| | | | | | | | | | | | | | | The main problem with video PTS was that it wasn't very useful when playing audio files with cover art. Using the audio time instead was an obvious solution. Unfortunately, this leads to "inexact" reporting of the playback time in paused mode, and audio is always ahead by small, essentially random amounts of time ahead. This is possibly because the times reported by AOs are not entirely accurate when paused (see commit 9b3bf76). Switch back to video PTS, and use a simpler way to deal with the cover art case: if the video has ended, use the audio PTS. Also see commit f9a259e (and the commits referenced from there).
* mplayer: fix framestepping on ordered chapter segment boundarieswm42013-04-041-28/+34
| | | | | | | | | | | | | | | | | | | Trying to step over a segment boundary didn't work, and the video was stuck at the end of the current chapter. At this point, both video and audio of the segment has ended, and the segment switching code is going to call seek() to go to the next segment (the part of the code in run_playloop that uses end_is_chapter). However, this seek() is not called if playback is paused, and the framestepping code always paused before this code is run. Move the framestepping code below the chapter switching code. The added restart_playback condition makes sure the code is called only after at least one video frame has been shown. Also don't reset the framestep counter after seek. It's not needed, and removing it prevents full unpausing when stepping over a segment boundary. This also terminates playback when frame stepping at the end of the file. The --keep-open option can be used to get the old behavior.
* mplayer: fix --step EOF handlingwm42013-04-041-1/+3
|
* remove Apple Remote related codeStefano Pigozzi2013-03-316-677/+0
| | | | | | | | | | | | | | | | The OSX part of the Apple Remote was unmaintained for a long time and was not working anymore. I tried to update the cookies to what the current versions of OS X expect without much luck. I decided to remove it since Apple is not including the IR receiver anymore in new hardware and it's clear that wifi based remotes are the way to go. A third party iOS app should be used in it's place. In the future we could look into having a dedicated iOS Remote Control app like VLC and XBMC do. The Linux side (`appleir.c`) was relatively tidy but it looks like LIRC can be configured to work with any version of Apple Remote [1] and is more maintained. [1] LIRC Apple Remote configs: http://lirc.sourceforge.net/remotes/apple/
* osd: draw the OSD bar with ASS vector drawingswm42013-03-304-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | Drawing the bar with vector drawings (instead with characters from the OSD font) offers more flexibility and looks better. This also adds chapter marks to the OSD bar, which are visible as small triangles on the top and bottom inner border of the bar. Change the default position of the OSD bar below the center of the screen. This is less annoying than putting the bar directly into the center of the view, where it obscures the video. The new position is not quite on the bottom of the screen to avoid collisions with subtitles. The old centered position can be forced with ``--osd-bar-align-y=0``. Also make it possible to change the OSD bar width/height with the new --osd-bar-w and --osd-bar-h options. It's possible that the new OSD bar renders much slower than the old one. There are two reasons for this: 1. the character based bar allowed libass to cache each character, while the vector drawing forces it to redraw every time the bar position changes. 2., the bar position is updated at a much higher granularity (the bar position is passed along as float instead of as integer in the range 0-100, so the bar will be updated on every single video frame).
* vo: rename vo_draw_image to vo_queue_imagewm42013-03-281-2/+2
|
* vo_opengl: split into multiple files, convert to new option APIwm42013-03-281-0/+10
| | | | | | gl_video.c contains all rendering code, gl_lcms.c the .icc loader and creation of 3D LUT (and all LittleCMS specific code). vo_opengl.c is reduced to interfacing between the various parts.
* core: always pass data via packet fields to video decoderswm42013-03-281-10/+9
| | | | | | | Makes the code a bit simpler to follow, at least in the "modern" decoding path (update_video_nocorrect_pts() is used with old demuxers, which don't return proper packets and need further parsing, so this code looks less simple now).
* m_option: pretty-print floats with 3 pre-decimal digits instead of 2wm42013-03-261-6/+6
| | | | | | There were complaints that ${fps} was printed as e.g. "23.98" instead of "23.976". Since there's no way to format floats exactly _and_ in a user- friendly way, just change the default precision for printing floats.
* core: output --playing-msg message only after at least one frame is shownwm42013-03-262-6/+9
| | | | | | | | | | | | | | | | This way it's possible to retrieve correct information about video, like actual width/height, which in general are available only after at least one frame has been sent to the video output, such as dwidth/dheight. mpv_identify.sh becomes a bit slower, because we let it decode enough audio and video to fill the audio buffers and to send one frame to the video output. Also, --playing-msg isn't shown anymore with --frames=0 (could be fixed by special-casing it, should this break any use cases). Note that in some corner cases, like when the demuxer for some reason returns lots of audio packets but no video packets at the start, but video actually starts later, the --playing-msg will still be output before video starts.
* mplayer: make --frames=1 work for audiowm42013-03-261-10/+15
| | | | | | | This has the same (useless) definition as frame stepping in audio-only mode: one frame means one playloop iteration. (It's relatively useless, because one playloop iteration has a random duration. But it makes --frames=1 work, which is useful again.)
* mplayer: cosmetics: make some code more readablewm42013-03-261-13/+13
|
* command: export VO video width/height as propertieswm42013-03-261-0/+24
| | | | | | Add new properties "dwidth" and "dheight", which contain the video size as known by the VO (not necessarily what the VO makes out of them, i.e. without window scaling and panscan).
* input: make input command deprecation warnings visiblewm42013-03-262-3/+3
| | | | | | | | | | | | | | | | Some time ago, all old special-cased commands (like "volume 1" to change volume by one) have been removed. These commands are still emulated using simple text replacement. This emulation is done to not break everyone's input.conf, especially because the input.conf provided by standard mplayer* still uses the old commands. Every use of a deprecated command prints a replacement warning, which was visible only with -v. Make these warnings visible by default. There's actually not much reason to do this, but since commands like "volume 5 1" don't work anymore, it's better to be verbose about this. Also simplify the replacement for "vo_fullscreen".
* mp_msg: don't change text color for normal outputwm42013-03-261-2/+8
| | | | | | | | | | Normal text was set to gray foreground color. This didn't work for terminals with white background. Instead of setting a color for normal text, reset the color attributes. This way, only errors and warnings are formatted differently. Also change the default color for MSGL_HINT from bold white to yellow.
* input: fix crash due to dangling pointerwm42013-03-191-1/+1
| | | | | Wrong API usage, has been in the code since 2011. Rarely triggered (if at all in the current setup).
*