summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* stream_lavf: print lavf options that could not be setwm42013-09-221-0/+6
| | | | | | | | | Mainly for debugging. Usually, we just set options for all possible protocols, and we can't really know whether a certain protocol is used beforehand. That's also the reason why avio_open2() takes a dictionary, instead of letting the user set options directly with av_opt_set(). Or in other words, we don't know whether an option that could be set is an error or not, thus we print the messages only at verbose level.
* command: when changing volume while muted, show an extra message on OSDwm42013-09-211-1/+2
| | | | | So nobody has to wonder why everything is silent, even if they raise the volume.
* command: when changing a property, allow showing an extra OSD messagewm42013-09-214-33/+50
| | | | | | | | | | This is for properties that normally show a bar, and thus do not show an OSD message (as per classic mplayer behavior). Setting an extra_msg allows showing an OSD message anyway, except if OSD messages are explicitly suppressed. This refactors the whole show_property_osd() function a bit, and replaces the weird sep field with a more general method.
* m_property: add a way to switch on property values in property expansionwm42013-09-202-6/+24
| | | | | | | | | | Allows for example: --status-msg='${?pause==yes:(Paused) } ...' to emulate the normal terminal status line. It's useful in other situations too. I'm a bit worried about extending this mini-DSL, and sure hope nobody will implement a generic formula evaluator at some point in the future. But for now we're probably safe.
* m_property: rearrange codewm42013-09-201-20/+27
|
* command: don't append, but prepend deinterlace filter by defaultwm42013-09-201-1/+1
| | | | | | In most cases, it's better if deinterlacing happens before any other filtering, so prepend the filter to the user's filter list, instead of appending it.
* vo_lavc: mp_msg conversionwm42013-09-201-34/+27
| | | | Also restores consistent log message prefixes with ao_lavc.
* command: use a list of potential deinterlacer filterswm42013-09-201-13/+22
| | | | | | | | Instead of hardcoding a single filter. This might be helpful for modeling the vaapi deinterlacer as a video filter. The idea is that a software deinterlacer would be tried first, and if that fails (because vaapi hardware decoding uses HW surfaces, which a software deinterlacer does not accept), the vaapi filter would be tried.
* vo/x11_common: don't require a working input methodwm42013-09-201-14/+9
| | | | | | | Normally, we need this for Xutf8LookupString(). But we can just fall back to XLookupString(). In fact, the code for this was already there, the code was just never tested and was actually crashing when active (see commit 2115c4a).
* vf: fix filter initialization error checkwm42013-09-201-1/+1
| | | | | vf_open returns 0 on error, 1 on success. Oops. Accidentally broken with 6629a95.
* ao_pulse: bug fix: goto the correct error handlerJohan Kiviniemi2013-09-201-2/+2
|
* ao_pulse: set the property media.role=videoJohan Kiviniemi2013-09-201-2/+17
|
* Merge branch 'volume_restore'wm42013-09-2014-227/+290
|\
| * af: merge af_reinit() and fix_output_format()wm42013-09-202-30/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling them separately doesn't really make sense, and all existing calls to them usually combined them. One subtitle difference was that af_init() didn't wipe the filter chain if initialization of the chain itself failed, but that didn't really make sense anyway. Also remove af_init() from the code for setting balance in mixer.c. The mixer should be in the initialized state only if audio is fully initialized, so the af_init() call made no sense. Note that the filter "editing" code in command.c doesn't really do a nice job of handling errors in case recreating an _old_ (known to work) filter chain unexpectedly fails, and this obscure/rare case might be differently handled after this change.
| * mixer: make struct opaquewm42013-09-207-57/+64
| | | | | | | | Also remove stray include statements from ao_alsa and ao_oss.
| * mixer: allow accessing volume and mute property on disabled audiowm42013-09-201-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The volume is set as soon as the audio chain is created again. This works only in softvol mode. For system wide volume or otherwise externally user controllable volume, this code is intentionally disabled. It would be extremely weird if changing volume (while audio is not initialized) would do nothing, and then suddenly change it when the audio chain is created. There's another odd corner case: the user-set volume will be thrown away if it's set before the _first_ audio chain initialization. This is because the volume restore logic recognizes a change from nothing to softvol or an AO, and circumventing that would require additional code. Also, we don't even know the start volume before that point. Forcing the volume with --volume will can override the volume set during no-audio mode, depending on the situation.
| * manpage: af_volnorm was renamedwm42013-09-202-1/+2
| |
| * mixer: restore volume with playback resumewm42013-09-207-3/+61
| | | | | | | | | | | | | | | | | | Note that this is intentionally never done if the AO or softvolume is different, or if the current volume control method is thought to control system wide volume (such as ALSA) or otherwise user controllable (such as PulseAudio). The intention is to keep things robust and to avoid messing with the user's audio settings as far as possible, while still providing the ability to resume volume if it makes sense.
| * mixer: don't unmute audio when raising volumewm42013-09-191-2/+0
| | | | | | | | This is rather strange behavior, away with it.
| * mixer: refactor, fix some aspects of --volume handlingwm42013-09-194-104/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor how mixer.c does volume/mute restoration and initialization. Move to handling of --volume and --mute to mixer.c. Simplify the implementation of these and hopefully fix bugs/strange behavior related to using them as file-local options (this uses a somewhat dirty trick: the option values are reverted to "auto" after initialization). Put most code related to initialization and volume restoring in probe_softvol() and restore_volume(). Having this code all in one place is less confusing. Instead of trying to detect whether to use softvol at runtime, detect it at initialization time using AOCONTROL_GET_VOLUME (same with mute, AOCONTROL_GET_MUTE). This implies we expect SET_VOLUME/SET_MUTE to work if the GET variants work. Hopefully this is always the case. This is also preparation for being able to change volume/mute settings if audio is disabled, and for allowing restoring value with playback resume.
| * mixer, af_volume: use linear values instead of dBwm42013-09-192-21/+21
| | | | | | | | | | | | | | Softvol always used a linear multiplier for volume control. This was converted to dB, and then back to linear in af_volume. Remove this non- sense. We still try to keep the command line argument to af_volume in dB, though.
| * mixer: minor refactoringwm42013-09-193-33/+31
| | | | | | | | | | Let struct mixer access access MPOpts to simplify some things. Rename some variables and functions. There should be no functional changes.
* | vo/x11_common: remove superfluous msg prefixesMartin Herkt2013-09-201-2/+2
| |
* | macosx_application: fix regression causing crashStefano Pigozzi2013-09-191-2/+11
| | | | | | | | | | 95a2151d1 introduced a crash on systems lower than 10.9 when opening files with a single argument.
* | Revert "osxbundle: fonts.conf: only look for fonts in ~/.mpv/fonts"Stefano Pigozzi2013-09-192-9/+5
| | | | | | | | | | | | | | Commit broke text subtitles without embedded fonts. Will look for a better solution later. Revert it for now, since I'm starting to get bug reports. This reverts commit 4a9f618d9f3b2d964bcc819426cc3042b8e447f7.
* | vo/x11_common: Fail init with no valid XIMMartin Herkt2013-09-191-0/+9
| | | | | | | | | | | | XOpenIM can fail to find a valid input method, in which case it returns NULL. Passing a NULL pointer to XCreateIC would cause a crash, so fail VO init before that happens.
* | wayland/common: exit properly on fd errorsAlexander Preisinger2013-09-191-2/+6
| | | | | | | | | | | | | | Before this commit there was just an error message, but the file descriptor was still open. Now we close the file descriptor and prevent it from calling endlessly. Also a CLOSE_WIN event is sent which closes the window eventually if the action of CLOSE_WIN is set to quit or quit_watch_later.
* | mplayer: rename a somewhat misnamed functionwm42013-09-191-2/+2
| |
* | vo_opengl: blend alpha components by defaultwm42013-09-195-13/+29
|/ | | | | | Improves display of images and video with alpha channel, especially if the transparent regions contain (supposed to be invisible) garbage color values.
* af_export: fix compilation warningwm42013-09-191-2/+1
| | | | Blargh.
* osxbundle: fonts.conf: only look for fonts in ~/.mpv/fontsStefano Pigozzi2013-09-182-5/+9
| | | | | | | | This is to avoid the 30s hang while mpv caches fonts. In practice all the fonts an average user is going to use are embedded in mkv files so there is no reason to build fontconfig's cache on all of OS X system directories. I might add something similar for terminal usage, but I am highly undecided.
* Config path functions can return NULLwm42013-09-182-3/+11
| | | | | | | It's quite unlikely, but functions like mp_find_user_config_file() can return NULL, e.g. if $HOME is unset. Fix all the code that didn't check for this correctly yet.
* osdep/path: remove ifdefswm42013-09-181-6/+0
| | | | They're not really needed, so kill them.
* macosx: move bundle path stuff to path-macosx.mStefano Pigozzi2013-09-185-40/+16
| | | | This makes the code uniform to how stuff was handled for Windows in 1cb55ceb.
* path, win32: redo user configfile path handlingwm42013-09-185-72/+102
| | | | | | | | | | | | | | | | | Remove the ifdef hell from mp_find_user_config_file(). Move the win32 specific code (for MinGW and Cygwin) to path-win.c. The behavior should be about the same, but I can't be sure due to lack of testing and because the old path.c code was hard to follow. (I expect those who care about windows will fix things, should issues pop up - sorry.) One difference is that the new code will always force MPV_HOME. It looks like the old code preferred the mpv config dir in the exe dir if it exists. Also, make sure MP_PATH_MAX has enough space, even if the equivalent wchar_t string is not 0-terminated with PATH_MAX (because apparently the winapi doesn't require this). (Actually, maybe we should just kill all uses of PATH_MAX/MP_PATH_MAX.)
* win32: add getenv() UTF-8 variantwm42013-09-182-0/+62
| | | | | | | This is a bit "hard", because getenv() returns a static string, and we can't just return an allocated string. We also want getenv() to be thread-safe if possible. (If the mpv core is going to be more threaded, we sure do want the lower layers to be thread-safe as well.)
* path: fix undefined behaviorwm42013-09-181-2/+2
| | | | | | | The homepath variable was static, and its value was set to a stack buffer. This means a second invocation of the function would trigger undefined behavior. Moreover the stack buffer always went out of scope before homepath was used.
* cocoa_common: signal a mouse movement when changing window sizeStefano Pigozzi2013-09-181-0/+8
| | | | | | | | | This is mainly to avoid spurious cursor states due to the mouse moving inside or outside the window as a result of the window resize (with cmd-0/1/2). This avoids complex logic and triggers a mouse move so that the player recomputes the correct cursor state based on the autohide configuration of the user.
* cocoa_common: override core's cursor visibility stateStefano Pigozzi2013-09-181-3/+5
| | | | | | | This keeps the state in sync with the current state in cocoa_common. Infact the cocoa code in mpv can decide wether it really wants to hide the cursor based on the result of the `canHideCursor` method (this is so that the cursor is only hidden when hovering on the video window).
* HIDRemote: remove OS X version checksStefano Pigozzi2013-09-171-44/+1
| | | | | | Turns out that these checks were for versions of OS X that mpv doesn't even support anymore. So just remove the checks since they cause a deprecation warning.
* find_subfiles: fix really dumb bug causing segfaultswm42013-09-171-1/+1
| | | | | | | NULL pointer deref when a .sub file with the same filename as the video file was present. I was probably half asleep when writing this code.
* macosx_application: remove deprecation warning on OS X 10.9Nyx0uf2013-09-161-15/+29
| | | | | | | | | | | | GetCurrentProcess() is deprecated on 10.9. Make a universal solution by checking OS version number. get_system_version() function is the recommended Apple way of getting the OS version, since Gestalt is also deprecated (and does pretty much the same thing anyway) Updating HIDRemote.m to use a similar function would allow to get rid of the 2 other warnings.
* gl_common: add wayland backend before x11 backendAndreas Sinz2013-09-161-3/+5
|
* gl_common: signal to GL backend whether we are probingwm42013-09-164-7/+16
| | | | | | | | | | | This is supposed to reduce the amount of useless error messages shown during initialization of vo_opengl. If multiple backends are compiled, usually only one of them will work. For example, on Linux both X and Wayland backends can be compiled, but usually either Wayland or X is running. Then, if Wayland is not running, but X is, trying to initialize the Wayland backend should not spam the terminal with error messages. Signed-off-by: Andreas Sinz <andreas.sinz@aon.at>
* mplayer: read subtitle packets as soon as possiblewm42013-09-161-8/+5
| | | | | | | | | | | | | Call update_subtitles() on every iteration of the playloop, so that subtitle packets are read as soon as possible, instead of every time a video frame is displayed. This helps in case the packet queue is swamped with subtitle packets, which can happen with certain insane mkv files. The change will simply cause the subtitle queue to be emptied on each playloop iteration. The timestamps update_subtitles() uses for display are the same before and after this commit. (Important for files which have subtitle packets with timestamps or duration not set.)
* demux_mkv: don't add too many subtitle packets during seekingwm42013-09-161-14/+19
| | | | | | | | | | | | | | | | | | | | | In insane files with a very huge number of subtitle events, and if the --demuxer-mkv-subtitle-preroll option is given, seeking can still overflow the packet queue. Normally, the subtitle_preroll variable specifies the maximum number of packets that can be added. But once this number is reached, the normal seeking behavior is enabled, which will add all subtitle packets with the right timestamps to the packet queue. At this point the next video keyframe can still be quite far away, with enough subtitle packets on the way to overflow the packet queue. Fix this by always setting an upper limit of subtitle packets read during seeking. This should provide additional robustness even if the preroll option is not used. This means that even with normal seeking, at most 500 subtitle packets are demuxed. Packets after that are discarded. One slightly questionable aspect of this commit is that subtitle_preroll is never reset in audio-only mode, but that is probably ok.
* command: force video refresh when changing aspectwm42013-09-151-1/+2
| | | | | Pausing the player and changing the aspect would leave the VO without a frame to display.
* manpage: remove bogus space in example usagewm42013-09-151-1/+1
|
* Add mpv.desktop, let Makefile install the desktop file and the iconswm42013-09-152-4/+45
| | | | | | | | | | | | | | | | | | | The mpv.desktop file is taken from the Arch package [1]. It appears to be based on the mplayer2 git mplayer.desktop file (e.g. very similar MimeType field), with minor modifications applied by Arch package maintainers. Note that for now, this doesn't show a terminal (Terminal=false), which might not always be ideal. For example, if the file is audio only, or if VO initialization fails for some reason, mpv will run in the background and play audio without showing a window. But users prefer running it without terminal, and don't want to play audio files with it. Maybe a --force-window option will be added in the future, which would always create a VO window, and compensate for these issues. [1] https://aur.archlinux.org/packages/mpv-git/
* manpage: remove version and date fieldswm42013-09-151-2/+0
| | | | | | | | These would have to be updated manually all the time. Replacing them automatically would be possible, but additional work, and would force regeneration of the manpage way too often. We decided that we don't need these fields.
* screenshot: change %w format to be more like %twm42013-09-152-22/+17
| | | | | | Instead of containing a format string within %w{...}, simply allow %w to specify one item of a time format string. This is simpler, more like other format specifiers (%t), and probably easier to use too.
* mplayer: attempt to skip playlist entries which can't be playedwm42013-09-154-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is for situations when repeated attempts at playing a playlist entry failed, and playlist navigation becomes impossible due to that. For example, it wasn't possible to skip backwards past an unplayable playlist entry: mpv file1.mkv doesntexist.mkv file3.mkv You couldn't skip back to file1.mkv from file3.mkv. When running a single "playlist_prev" command, doesntexist.mkv would be played, which would fail to load. As reaction to the failure to load it, the next file would be played, which is file3.mkv. To make this even worse, the file could successfully load, but run only for a split second. So just loading successfully isn't good enough. Attempt to solve this by marking problematic playlist entries as failed, and by having playlist_prev skip past such playlist entries. We define failure as not being able to play more than 3 seconds (or failing to initialize to begin with). (The 3 seconds are in real time, not file duration.) "playlist_prev force" still exhibits the old behavior. Additionally, use the same mechanism to prevent pointless infinite reloading if none of the files on the playlist exist. (See github issue All in all, this is a heuristic, and later adjustments might be necessary. Note: forward skips (playlist_next) are not affected at all. (Except for the interaction with --loop.)
* screenshot: make it possible to format playback time in various wayswm42013-09-152-0/+40
|
* mp_common: add function which accepts a format string to format playback timewm42013-09-152-11/+50
|
* mplayer: don't run heartbeat command while pausedwm42013-09-152-3/+5
| | | | | | | | This is commonly used to disable the screensaver with broken/non- standard X screensavers. During pause, the screensaver should not be disabled, so not calling this command while paused seems sensible. See github issue #236.
* av_log: show ffmpeg "info" messages with -v onlywm42013-09-151-1/+1
| | | | | | | | | | | | | | | | | They are rarely useful in my opinion. This commit was mainly motivated by this message: Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using a tool like VirtualDub or avidemux to fix it. It's what's left over from the "Invalid and inefficient vfw-avi..." warning that used to be printed when playing avi/divx files. Although the new message is much better, it's still rather useless and poses more questions than it answers. Besides, nobody wants to remux a file when playing it, especially not if playback appears to be completely fine. (There are some claims that these files raise CPU usage, but even my old crappy CPU can decode low res avi/divx files at real time at about x35 playback speed.)
* mplayer: m_option: fix clang -Wformat compiler warningStefano Pigozzi2013-09-142-2/+2
| | | | Code was using %d format instead %zd to print size_t data.
* stream_dvd: prevent segmentation fault with some broken filesStefano Pigozzi2013-09-141-2/+2
| | | | |