summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* af: remove automatically inserted filters on full reinitwm42013-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | Make sure automatically inserted filters are removed on full reinit (they are re-added later if they are really needed). Automatically inserted filters were never explicitly removed, instead, it was expected that redundant conversion filters detach themselves. This didn't work if there were several chained format conversion filters, e.g. s16le->floatle->s16le, which could result from repeated filter insertion and removal. (format filters detach only if input format and output format are the same.) Further, the dummy filter (which exists only because af.c can't handle an empty filter chain for some reason) could introduce bad conversions due to how the format negotiation works. Change the code so that the dummy filter never takes part on format negotiation. (It would be better to fix format negotiation, but that would be much more complicated and would involving fixing all filters.) Simplify af_reinit() and remove the start audio filter parameter. This means format negotiation and filter initialization is run more often, but should be harmless.
* 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).
* input/ar: remove unused variablewm42013-03-191-1/+0
|
* mp_msg: print MSGL_STATUS to stderr if stderr is redirectedRudolf Polzer2013-03-181-2/+2
| | | | | Of course, status output is still hidden when stderr is a tty which is not the foreground tty.
* mp_msg: fix status output disappearing when redirecting INPUT.Rudolf Polzer2013-03-181-2/+2
| | | | | Instead, we now check stderr's destination against the foreground tty for deciding whether we want status output or not.
* options: fix --widwm42013-03-181-1/+1
| | | | | | A recent change accidentally set the flags options to -1 (probably confusing it with the defasult value?), which mistakenly set all flags and rejected all option values (except 0).
* configure: bump minimum FFmpeg/Libav versions, remove compat hackswm42013-03-131-74/+0
| | | | | | | | | | | | | | | | | We consider FFmpeg 1.x and Libav 0.9.x releases compatible. Support for FFmpeg 0.9.x and Libav 0.8.x is considered infeasible and has been dropped in the previous commits. The bits that break compatibility are mainly the CodecID renaming (trivial, but would require nasty hacks everywhere), the avcodec_encode_video2() function (missing in older releases, mandatory in newer ones), and the resampler changes (older releases miss lib{av,sw}resample, newer versions removed the libavcodec resampler). Remove some other compatibility bits that were needed to for releases for which we drop support. The comment about Libav 0.9 in compat/libav.h is incorrect and should have been 0.8 (the symbol is present in Libav 0.9).
* Prefix CODEC_ID_ with AV_wm42013-03-131-29/+29
| | | | | | | | | The old names have been deprecated a while ago, but were needed for supporting older ffmpeg/libav versions. The deprecated identifiers have been removed from recent Libav and FFmpeg git. This change breaks compatibility with Libav 0.8.x and equivalent FFmpeg releases.
* core: remove a number of global variableswm42013-03-089-112/+103
| | | | | | | | | | | Move them into per-instance structs. This should get rid of all global variables in mplayer.c (not counting those referenced by cfg-mplayer.h). In core/input/ar.c, just remove checking the slave_mode variable. I'm not sure what this code was supposed to achieve, but slave mode is broken, slave mode is actually infeasible on OSX (ar.c is completely OSX specific), and the correct way of doing this would be to disable this input device per command line switch.
* core: make more robust against missing libavcodec AVCodecDescriptor entrieswm42013-03-071-3/+18
| | | | | | | | | | | Missing entries cause avcodec_descriptor_get() to return NULL, and in turn mp_codec_from_av_codec_id() will return NULL. This shouldn't happen, and avcodec_descriptor_get() returning NULL for a valid codec is clearly a bug. But make it more robust anyway, and use the decoder's name if this happens, because I doubt maintainance of the AVCodecDescriptor table in ffmpeg/Libav will always be perfect and reliable.
* options: fix panscan controlswm42013-03-061-1/+1
| | | | | | | The value range was set to 1-99 instead of 0-1. This broke panscan control with the 'w' and 'e' keybindings. Broken by commit 1198c03.
* options: remove --no-vsyncwm42013-03-063-4/+0
| | | | | | Latest nvidia drivers ignore the application setting, so this switch makes even less sense than before. It's still possible to control this with VO specific suboptions.
* vo: Separate vo options from MPOptsAlexander Preisinger2013-03-045-46/+49
| | | | | | | Separate the video output options from the big MPOpts structure and also only pass the new mp_vo_opts structure to the vo backend. Move video_driver_list into mp_vo_opts
* Remove vo_fps global variablewm42013-03-044-5/+22
| | | | | This is needed by the encode stuff for some reason, so we have to explicitly pass it. Functionality shouldn't change.
* Add a --dtshd optionWessel Dankers2013-03-042-0/+2
| | | | | | | | | | The spdif decoder was hardcoded to assume that the spdif output is capable of accepting high (>1.5Mbps) bitrates. While this is true for modern HDMI spdif interfaces, the original coax/toslink system cannot deal with this and will fail to work. This patch adds an option --dtshd which can be enabled if you use a DTS-capable receiver behind a HDMI link.
* vo: remove and cleanup globalsAlexander Preisinger2013-03-046-93/+131
| | | | | | | | Removes almost every global variabel in vo.h and puts them in a special struct in MPOpts for video output related options. Also we completly remove the options/globals pts and refresh rate because they were unused.
* x11_common: fix --cursor-autohide when pausedwm42013-03-031-2/+8
| | | | | | | | When paused, --cursor-autohide worked with a precision of 500ms, which is the main loop's default sleep time when paused. Cursor hiding is polled in x11_common, and the main loop never called the X11 code at the right time. Fix this by allowing the VO to set a time when it should be called next.
* core: fix SEEK_FACTORwm42013-03-012-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Emulate percentage-seeks (SEEK_FACTOR) as normal time-seeks if possible. This fixes some issues with (let's call it) low quality implementations of SEEK_FACTOR (e.g. demux_mkv basically interprets this as byte-seek, and also seeking to 99.9% makes it seek back to the start). For weird MPEG formats the demuxer level SEEK_FACTOR is still used. These formats, which can have timestamp resets, are identified by setting demuxer->ts_resets_possible to true. Also, have get_current_pos_ratio() follow the same rules, and calculate the percentage position with the file position if timestamp resets are possible. This actually fixes percentage-seeks in .ts files with demux_lavf.c. This kind of seek is not really used now, but it will be more important when we add a progress bar. Note: seeking in chained ogg files is still completely broken. The main issue is that ffmpeg doesn't provide a sane API for dealing with timestamp resets, and trying to do byte seeks with ogg confuses demuxer and decoder (or something like this) and just does random things. (Tested with two concatenated flac-in-ogg files).
* m_option: don't define OPT_BASE_STRUCT by defaultwm42013-03-013-2/+4
| | | | | | | | | | | OPT_BASE_STRUCT defines which struct the OPT_ macros (like OPT_INT etc.) reference implicitly, since these macros take struct member names but no struct type. Normally, only cfg-mplayer.h should need this, and other places shouldn't be bothered with having to #undef it. (Some files, like demux_lavf.c, still store their options in MPOpts. In the long term, this should be removed, and handled like e.g. with VO suboptions instead.)
* m_option: reformat option macro definitionswm42013-03-011-31/+102
| | | | Slightly more bearable, but it's still incredibly ugly.
* m_options: more typesafetywm42013-03-014-30/+73
| | | | | | | | | | | | | Change the option definition macros so that they cause compiler warnings if the type of the referenced option struct member doesn't match the type implied by the macro. The compiler warning printed isn't very telling, but it's better than silently invoking undefined behavior by violating the C strict aliasing rules. Also fix some minor cases that violate the type rules. For the option "no-aspect" we have to add a new option type to handle it properly. Some option types are hard to check, so we don't in these cases.
* core: move X11 specific code to x11_common.cwm42013-03-011-5/+0
| | | | | Nothing changes, because vo_check_events() is called at the same place anyway.
* core: simplify OSD capability handling, remove VFCAP_OSDwm42013-03-011-3/+2
| | | | | | | | | | | | | | | | | | | VFCAP_OSD was used to determine at runtime whether the VO supports OSD rendering. This was mostly unused. vo_direct3d had an option to disable OSD (was supposed to allow to force auto-insertion of vf_ass, but we removed that anyway). vo_opengl_old could disable OSD rendering when a very old OpenGL version was detected, and had an option to explicitly disable it as well. Remove VFCAP_OSD from everything (and some associated logic). Now the vo_driver.draw_osd callback can be set to NULL to indicate missing OSD support (important so that vo_null etc. don't single-step on OSD redraw), and if OSD support depends on runtime support, the VO's draw_osd should just do nothing if OSD is not available. Also, do not access vo->want_redraw directly. Change the want_red