summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* msg: update commentwm42014-01-151-1/+1
|
* msg: terminal OSD uses stderr, not stdoutwm42014-01-151-1/+1
| | | | | | This is more correct. E.g. if you do "mpv file.mkv > /dev/null", stdout will not be a terminal, but stderr (used by terminal OSD and status line) is.
* w32_common: prevent decoding certain keys twiceJames Ross-Gowan2014-01-151-12/+34
| | | | | | | | This is a bit of a hack, but in order to prevent TranslateMessage from seeing WM_KEYDOWN messages that we already know how to decode, move the decoding logic to the event loop. This should fix #476, since it stops the generation of extraneous WM_CHAR messages that were triggering more than one action on keydown.
* Detect Lua on FreeBSDGrzegorz Blach2014-01-152-1/+3
|
* player: don't print status in --idle modewm42014-01-141-1/+1
| | | | Apparently this annoys certain users. Restores old behavior.
* player: avoid stalling when starting a network streamwm42014-01-143-2/+9
| | | | | | | | | | | | Starting a network stream could stall by executing uncacheable stream control requests (STREAM_CTRL_GET_LANG and STREAM_CTRL_GET_DVD_INFO). Being uncacheable means the player has to wait until the cache is done reading the current block of data. These requests can't be cached because they're too complicated, so the only way to avoid them is special casing the DVD and Bluray streams (which are the only things which need these requests), and not doing them in other cases. (This is kind of inelegant, but so is the rest of the DVD/BD code.)
* cocoa: add application icon to the Dock when run from CLIStefano Pigozzi2014-01-143-0/+25
| | | | | | | | | | Application icon was added to the Dock only when run inside of a bundle. That was handled automatically by OS X using the Info.plist definition. To add the Application icon when run as a CLI program, I used the samme approach in the X11 code and loaded the icon as a static binary blob inside of mpv's binary. This is the simplest approach as it avoid headackes when relocating the binary and such.
* ebml: remove length parameters from read functionswm42014-01-143-39/+27
| | | | | | | Many ebml_read_* functions have a length int pointer parameter, which returns the number of bytes skipped. Nothing actually needed this (anymore), and code using it was rather hard to understand, so get rid of them.
* ebml: remove unused functionswm42014-01-142-90/+0
| | | | These were mostly replaced by ebml_read_element().
* demux_mkv: remove unused macroswm42014-01-141-3/+0
|
* demux_mkv: improve robustness by explicitly checking for level 1 elementswm42014-01-143-46/+50
| | | | | | | | | | | | | | | | | | | | Matroska makes it pretty hard to resync correctly on broken files: random data returns "valid" EBML IDs with a high probability, and when trying to skip them it's likely that you skip a random amount of data (instead of considering the element length invalid). Improve upon this by skipping known level 1 elements only. Consider everything else invalid and call the resync code. This might result in annoying behavior when Matroska adds new level 1 elements, although it won't be particularly harmful. Matroska doesn't really allow us to do better (even mkvtoolnix explicitly checks for known level 1 elements). Since we now don't always want to combine EBML element skipping and resyncing, remove ebml_read_skip_or_resync_cluster(), and make ebml_read_skip() more tolerant against skipping broken elements. Also, don't resync when reading sub-elements, and instead do resyncing when reading them results in an error.
* demux_mkv: avoid skipping too much data in corrupted fileswm42014-01-143-14/+18
| | | | | | | | | | Until now, corrupted files were detected if the size of an element (that should be skipped) was larger than the remaining file. This still could skip larger regions of the file itself if the broken size happened to be within the file. Change it so that it's never allowed to skip outside the parent's element.
* msg: don't clear term OSD lines that are not usedwm42014-01-141-3/+5
|
* terminal-unix: fix terminfo/termcap name for cursor upwm42014-01-141-1/+1
| | | | | "ku" is for input, not output. This happened to work on urxvt, but broke on xterm (and probably a dozen of other terminals).
* msg: fix printing of module headerwm42014-01-141-1/+2
| | | | | The code to set root->header was moved before the point where it's used, which broke the logic.
* terminal-unix: add fallback for enter keywm42014-01-131-0/+3
| | | | This worked just fine if terminfo or termcap was available.
* terminal-unix: fix fallbacks in case terminfo/termcap are disabledwm42014-01-131-2/+2
| | | | | These two escape sequences were swapped. (They are used only if terminfo/termcap are not available.)
* terminal-unix: add termcap/terminfo documentation linkswm42014-01-131-0/+4
| | | | | | | Apparently, some people are not clever enough to google this information. Proper googling to find these links done by Kovensky.
* manpage: document --term-osd=forcewm42014-01-131-1/+3
| | | | | Apparently this was forgotten when it was first added, or maybe it's an arrifact from the rst conversion.
* player: redo terminal OSD and status line handlingwm42014-01-1314-92/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The terminal OSD code includes the handling of the terminal status line, showing player OSD messages on the terminal, and showing subtitles on terminal (the latter two only if there is no video window, or if terminal OSD is forced). This didn't handle some corner cases correctly. For example, showing an OSD message on the terminal always cleared the previous line, even if the line was an important message (or even just the command prompt, if most other messages were silenced). Attempt to handle this correctly by keeping track of how many lines the terminal OSD currently consists of. Since there could be race conditions with other messages being printed, implement this in msg.c. Now msg.c expects that MSGL_STATUS messages rewrite the status line, so the caller is forced to use a single mp_msg() call to set the status line. Instead of littering print_status() all over the place, update the status only once per playloop iteration in update_osd_msg(). In audio- only mode, the status line might now be a little bit off, but it's perhaps ok. Print the status line only if it has changed, or if another message was printed. This might help with extremely slow terminals, although in audio+video mode, it'll still be updated very often (A-V sync display changes on every frame). Instead of hardcoding the terminal sequences, use terminfo/termcap to get the sequences. Remove the --term-osd-esc option, which allowed to override the hardcoded escapes - it's useless now. The fallback for terminals with no escape sequences for moving the cursor and clearing a line is removed. This somewhat breaks status line display on these terminals, including the MS Windows console: instead of querying the terminal size and clearing the line manually by padding the output with spaces, the line is simply not cleared. I don't expect this to be a problem on UNIX, and on MS Windows we could emulate escape sequences. Note that terminal OSD (other than the status line) was broken anyway on these terminals. In osd.c, the function get_term_width() is not used anymore, so remove it. To remind us that the MS Windows console apparently adds a line break when writint the last column, adjust screen_width in terminal- win.c accordingly.
* player: don't block terminal OSD while seekingwm42014-01-131-3/+6
| | | | | | | | Seeking usually show the status on OSD. In terminal OSD mode, no status is shown, because there is already a separate status line. Unfortunately, the mechanism for showing the status was still active, which forced showing no message while the code for showing seek status was active.
* player: mention subtitles in av_desync_help_textwm42014-01-121-2/+2
| | | | | | | | Insane .ass subtitle scripts can cause severe slowdown (depending on the speed of the machine, or the insanity of the script), so mention how to test without subtitles. This is mainly to make the user aware that subtitle rendering can be a problem. For longwinded explanation, there isn't enough space.
* options: remove --screenw and --screenhwm42014-01-113-18/+2
| | | | | | | | | Doesn't make any sense anymore. X11 (which was mentioned in the manpage) autodetects it, and everything else ignored the option values. Since for incomprehensible reasons the backends and vo.c still need to exchange information about the screensize using the option fields, they're not removed yet.
* video/out: remove pointless x/y parameter from vo_x11_config_vo_windowwm42014-01-117-15/+10
| | | | | This never made any real sense; the "backend" has to access vo->dx/dy anyway.
* video/out: simplify monitor aspect handlingwm42014-01-119-39/+25
| | | | | | | | For some reason, this made all VO backends both set the screen resolution in opts->screenwidth/height, and call aspect_save_screenres(). Remove the latter. Move the code to calculate the PAR-corrected window size from aspect.c to vo.c, and make it so that the monitor PAR is recalculated when it makes sense.
* video/out: remove fallback handling for screensize/monitor pixel aspectwm42014-01-111-7/+1
| | | | | | | When using --monitoraspect, but either the screen width or height or both are unknown, a fallback is applied. This is a completely useless obscure corner case that's going to help nobody, so get it out of the way.
* cocoa: fix window placement on secondary screensStefano Pigozzi2014-01-111-3/+2
| | | | | | | | | | | | | | For a long time the cocoa backend set the xinerama_x/y and used dx/dy from the VO instance. This somewhat worked with some workarounds but wasn't really what was supposed to be happening. Moreover 27e4360, which touched this workaround introduced a regression. New code doesn't set the xinerama_x/y values so that dx/dy are offsets in the current screen (not a virtual screen composed of all the screens). The screen reference detected during VOCTRL_UPDATE_SCREENINFO is also passed down to the window initialization code. Fixes #472
* vd_lavc: matroska: remove weird code setting extra_huff for mjpegwm42014-01-111-12/+0
| | | | | | | | | | | Like with the previous commit, this is probably not needed, but it's unclear whether that really is the case. Most likely, it used to be needed by some demuxer, and now the only demuxer left that could _possibly_ trigger this is demux_mkv.c. Note that mjpeg is the only decoder that reads the extra_huff option, and nothing in libavformat actually sets the option. So maybe it's fundamentally not needed anymore.
* vd_lavc: matroska: remove weird realvideo special handlingwm42014-01-111-16/+1
| | | | | | | | | | | | | This case can't happen with the normal realvideo codepath in demux_mkv.c, because the code would errors out if the extradata is too small, and everything would be broken anyway in the case the vd_lavc.c condition is actually triggered. It still might happen with VfW-muxed realvideo in Matroska, though. Basically, I'm hoping this doesn't matter anyway, and that the vd_lavc.c code was for other old demuxers, like demux_avi or demux_rm. Following the commit history, it's not really clear for what demuxer this code was added.
* vd_lavc: minor simplificationwm42014-01-111-11/+2
|
* sd_lavc: use mp_lavc_set_extradata()wm42014-01-111-2/+2
| | | | | This includes the magical input padding required by libavcodec, which we possibly didn't do before this commit.
* Factor out setting AVCodecContext extradatawm42014-01-114-39/+27
|
* cocoa: refactor init window positioning codeStefano Pigozzi2014-01-101-2/+1
|
* cocoa: allow to drag and drop URLsNyx0uf2014-01-101-5/+19
| | | | | | | This commit also improves the visual feedback to the user by showing a plus icon in the mouse cursor when dragging supported types. Fixes #469
* demux_lavf: add hack for MicroDVD for assuming frame based timingwm42014-01-101-0/+6
| | | | | | | | | | | MicroDVD files _can_ contain real timestamps instead of frame timestamps if they declare a FPS. But this seems to be rare, so ignore that if the FPS happens to match with the libavformat microdvd parser's default FPS. This might actually break files that declare 23.976 FPS, but the video file is not 23.976 FPS, but the chance that this happens is probably very low, and the commit fixes the more common breakage with 25 FPS video.
* sub: fix frame based subtitle timestamp handlingwm42014-01-091-1/+1
| | | | | | Subtitle formats with frame based timing require using the video FPS to compute proper subtitle timestamps. But it looks like the calculation to do that was inversed.
* options: don't reset pause mode when switching to next filewm42014-01-092-4/+3
| | | | | | This basically reverts the default as set by commit 812798c5. This seems to be a matter of taste, but personally I think keeping the pause setting is better.
* command: don't access VO for output parameterswm42014-01-091-12/+18
| | | | | | Use the video chain for this instead. This is for facilitating coming changes, which will clean up the vo->aspdat stuff, and this code would be in the way.
* wayland: properly empty output listAlexander Preisinger2014-01-081-4/+4
|
* wayland/shm: don't crash if initialization failedAlexander Preisinger2014-01-081-3/+1
|
* wayland: fix crash when initialization failswm42014-01-081-1/+2
| | | | | | On X11, if no wayland compositor is running, wl_list_init() will never be called. This will cause destroy_display() to segfault when trying to iterate over the list.
* player: strip 'file://' from filenames on playback startwm42014-01-083-13/+34
| | | | | | | | | | | | This fixes two things: 1. Dropping files on the VO window will auto-load subtitles (since most drag & drop code prefixes the filenames with 'file://', and the subtitle auto-load code considers 'file://' non-local) 2. Fix behavior of the %x screenshot filename template (similar problem) One could force all that code to special-case 'file://' URLs, but just replacing the filename on playback start is simpler.
* screenshot: add format specifiers to get file directory pathwm42014-01-082-0/+27
| | | | | Useful if you want to put the screenshot into the same directory as the file that is being played.
* wayland/shm: tone down warningsAlexander Preisinger2014-01-081-2/+2
| | | | Those warnings are printed far too often and actually aren't usefull at all.
* wayland: fix memory leaksAlexander Preisinger2014-01-083-2/+24
| | | | | There are still some leaks from wayland-cursor stuff, but there is no way to free the memory as user of the cursor library.
* player: fix setting smaller timeout on Windows systemswm42014-01-081-1/+1
| | | | | | | On Windows, we don't have proper input event wakeup handling, so we need to lower the playloop timeout in order to react fast to input. Closes #387.
* waf: do not use TaskGen for PDF build ruleMartin Herkt2014-01-081-14/+6
| | | | No longer necessary.
* wayland: cleanup registry_handle_globalAlexander Preisinger2014-01-081-2/+1
| | | | | The wl_registry object is already passed as a parameter. No need to create a temporary variable.
* wayland: remove set_user_data from seat_listenerAlexander Preisinger2014-01-081-2/+0
| | | | | | | | | The user_data is passed on add_listener and can later be changed with set_user_data. But because we don't want to change it later and because it is the same object remove the set_user_data call. This might be a copy&paste leftover from the initial draft for the wayland backend.
* wayland: use static consistentlyAlexander Preisinger2014-01-081-4/+4
| | | | Declare everything that is only needed inside wayland_common.c as static.
* Switch PDF manual generation to rst2pdfMartin Herkt2014-01-086-58/+17
| | | | | | | This finally gets rid of the LaTeX dependency. We should actually be using docultils directly here, but I didn't do this because of all the potential Python 2/3 breakage.
* terminal: don't initialize termcap etc. if stdout is not a terminalwm42014-01-071-2/+6
| | | | | Otherwise, it seems one of the term* libraries will write escape sequences to stdout, for whatever reason.
* ao_pulse: lower default buffer size from 1000ms to 250mswm42014-01-072-2/+2
| | | | | | | | | | 1000ms is a bit insane. It makes behavior on playback speed changes worse (because the player has to catch up the dropped audio due to audio-chain reset), and perhaps makes seeking slower. Note that the problem of playback speed changes misbehaving will be fixed in the future, but even then we don't want to have a buffer that large.
* ao_pulse: add suboption to control buffer sizewm42014-01-072-1/+14
|
* wayland: fix fullscreen & resizing for goodAlexander Preisinger2014-01-073-12/+34
| | | | | | | I added enough logic to never set ontop or fullscreen twitce. This commit keeps also the size of the video if multiple videos are played. If the ratio differs the width will be kept at the same size and only the height changes.
* manpage: mention how to get a list of codecs for use with --hwdec-codecswm42014-01-071-0/+3
|
* wayland: silence annoying libwayland-client messagewm42014-01-071-0/+3
| | | | | | | | | | | | | | | | | libwayland-client contains the following code [1]: runtime_dir = getenv("XDG_RUNTIME_DIR"); if (!runtime_dir) { fprintf(stderr, "error: XDG_RUNTIME_DIR not set in the environment.\n"); This means this message will unconditionally and unavoidably be printed if XDG_RUNTIME_DIR is not set. Since mpv is a terminal program, and we want to avoid unnecessary output, work it around by not attempting to use wayland if this environment variable is not set. [1] http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-client.c#n636 (cd0dccd01e16fa404e03974d30ded3aebdb1c4bc)
* wayland: fix some memory leaks on initialization failurewm42014-01-071-6/+13
| | | | | | | | | | | This commonly happens when initializing vo_opengl on a X11-only system. Unfortunately, most wl_*_destroy() functions appear not to accept NULL pointers, making partial deinitialization a pain: you have to add your own NULL checks everywhere to avoid crashes. xkb.context is uninitialized separately, because you can initialize it just fine, even if the rest of input initialization fails.
* demux_lavf: fix minor memory leakwm42014-01-071-1/+1
|
* audio: fix previous commitwm42014-01-061-1/+1
|
* Fix audio delay inversionMartin Herkt2014-01-063-6/+6
|
* sub: fix previous commitwm42014-01-061-2/+2
| | | | sub_seek and sub_step were broken.
* Fix subtitle delay inversionMartin Herkt2014-01-062-2/+2
|
* w32_common: reformat yet againMartin Herkt2014-01-061-208/+208
| | | | | I've been told mpv prefers switch/case on the same indent level. Sorry about the noise :P
* cocoa: don't reset window size when the video size doesn't changeStefano Pigozzi2014-01-061-15/+14
| | | | Fixes #459
* w32_common: don't force topmost on fullscreenMartin Herkt2014-01-061-1/+2
| | | | Fixes #457, #444.
* Windows: use roaming AppData instead of localMartin Herkt2014-01-061-1/+1
| | | | Whatever. Fixes #458.
* win32-console-wrapper: use child process exit codeMartin Herkt2014-01-061-4/+6
|
* win32-console-wrapper: remove command line manglingMartin Herkt2014-01-061-11/+2
| | | | This wasn't really necessary and caused a lot of problems.
* w32_common: reformat slightlyMartin Herkt