summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vo_opengl: add radius options for filtersBin Jin2014-08-265-6/+33
| | | | | | | Add two new options, make it possible for user to set the radius for some of the filters with no fixed radius. Also add three new filters with the new radius parameter supported.
* vo_opengl: add cparam1 and cparam2 optionsBin Jin2014-08-264-21/+49
| | | | | | Although cscale is rarely used, it's possible that params of cscale are accidentally set to lparam1 and lparam2, which might cause unexpected results.
* vo_opengl: add spline64 filter kernelBin Jin2014-08-261-0/+19
| | | | | | | | The coefficients are taken from fmtconv plugin for vapoursynth: https://github.com/vapoursynth/fmtconv/blob/master/src/fmtc/ContFirSpline64.cpp The package is licensed under WTFPL, and it's from the same author of Dither plugin for avisynth.
* TOOLS: youtube wrapper: allow overriding mpv binarywm42014-08-261-1/+5
|
* player: fix weird behavior when framestepping over format changeswm42014-08-261-1/+1
| | | | | | | | | | When video format changes, the frame before the frame with the new format sets video_status briefly to STATUS_DRAINING. This caused the code to handle the EOF case to kick in, which just pauses the player when trying to step past the last frame. As a result, trying to framestep over format changes resulted in pausing the player. Fix by testing against the correct status.
* input: make key bindings like "Shift+X" work (for ASCII)wm42014-08-263-13/+30
| | | | | | | | | | | | | | "Shift+X" didn't actually map any key, as opposed to "Shift+x". This is because shift usually changes the case of a character, so a plain printable character like "X" simply can never be combined with shift. But this is not very intuitive. Always remove the shift code from printable characters. Also, for ASCII, actually apply the case mapping to uppercase characters if combined with shift. Doing this for unicode in general would be nice, but that would require lookup tables. In general, we don't know anyway what character a key produces when combined with shift - it could be anything, and depends on the keyboard layout.
* input: make all modifier flags unsignedwm42014-08-261-8/+8
|
* manpage: mention that mp.commandv doesn't expand propertiesOtto Modinos2014-08-251-0/+4
| | | | | | | | The little lua snippet at #488 as well as the actual implementation seems to indicate that not expanding properties is indeed the correct behavior. Document that. Signed-off-by: wm4 <wm4@nowhere>
* input: stdin is 0, not 1wm42014-08-251-1/+1
| | | | Oops. I can never remember this right.
* player: minor changeswm42014-08-253-16/+6
| | | | | | | | | | | | This shouldn't change anything functionally. Change the A/V desync message. --framedrop is enabled by default now, so the text must be changed a little. I've never heard of audio outputs messing up A/V sync recently, so remove that part. Remove the unused ao_pts field. Reorder 2 A/V sync related expressions so that they look the same.
* coreaudio_device: fix overwriting of user inputStefano Pigozzi2014-08-251-9/+8
| | | | Fixes #1030
* input: redo how --input-file is handledwm42014-08-255-24/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | Abandon the "old" infrastructure for --input-file (mp_input_add_fd(), select() loop, non-blocking reads). Replace it with something that starts a reader thread, using blocking input. This is for the sake of Windows. Windows is a truly insane operating system, and there's not even a way to read a pipe in a non-blocking way, or to wait for new input in an interruptible way (like with poll()). And unfortunately, some want to use pipe to send input to mpv. There are probably (slightly) better IPC mechanisms available on Windows, but for the sake of platform uniformity, make this work again for now. On Vista+, CancelIoEx() could probably be used. But there's no way on XP. Also, that function doesn't work on wine, making development harder. We could forcibly terminate the thread, which might work, but is unsafe. So what we do is starting a thread, and if we don't want the pipe input anymore, we just abandon the thread. The thread might remain blocked forever, but if we exit the process, the kernel will forcibly kill it. On Unix, just use poll() to handle this. Unfortunately the code is pretty crappy, but it's ok, because it's late and I wanted to stop working on this an hour ago. Tested on wine; might not work on a real Windows.
* msg: allow duplicating a mp_logwm42014-08-251-15/+20
| | | | Trivial; this is mostly just reindenting the normal codepath.
* command: change OSD formatting of "speed" propertywm42014-08-251-1/+1
| | | | The "x " prefix annoyed some users.
* options: compatibility hack for --slave-brokenwm42014-08-254-0/+12
| | | | | | | Seems some programs were still relying on it. Whatever, it's not hard to support. CC: @mpv-player/stable
* input: change verbosity of some message levelswm42014-08-251-3/+4
| | | | | | | For --input-test, print messages on terminal by default. Raise message level for enabling input sections, because the OSC makes this very extremely annoying.
* vo_opengl: don't cut off feature list outputwm42014-08-251-1/+1
|
* demux: always use AVPacketwm42014-08-254-65/+41
| | | | | | | | | | | | | | | | | | | | | This is a simplification, because it lets us use the AVPacket functions, instead of handling the details manually. It also allows the libavcodec rawvideo decoder to use reference counting, so it doesn't have to memcpy() the full image data. The change in av_common.c enables this. This change is somewhat risky, because we rely on the following AVPacket implementation details and assumptions: - av_packet_ref() doesn't access the input padding, and just copies the data. By the API, AVPacket is always padded, and we violate this. The lavc implementation would have to go out of its way to make this a real problem, though. - We hope that the way we make the AVPacket refcountable in av_common.c is actually supported API-usage. It's hard to tell whether it is. Of course we still use our own "old" demux_packet struct, just so that libav* API usage is somewhat isolated.
* win32: correct SGR sequence handlingJames Ross-Gowan2014-08-241-5/+13
| | | | | | This should get colour working again on the Windows console. Fixes #1032.
* win32: correct HANDLE typeJames Ross-Gowan2014-08-243-5/+5
| | | | | The correct type is HANDLE, not HANDLE*, though this change shouldn't affect functionality.
* demux: avoid unnecessary wakeupswm42014-08-241-1/+1
| | | | | | | | | If a packet is appended to a stream, and there were already packets queued, nothing about the state changed, as far as the user (i.e. the player) is concerned. Thus no wakeup is needed. The pthread_cond_signal() call following this is not interesting - it will simply be a NOP if there are actually no waiters.
* sd_lavc: remove ineffective codewm42014-08-241-4/+1
| | | | | | | | | It makes no sense to set the packet duration, because libavcodec doesn't know the timebase. And in fact, no subtitle decoder accesses the packet duration, except text subtitle converters, which are not relevant here. So this code did nothing - drop it. Also fix a blatantly incorrect comment.
* video: avoid unnecessary frame droppingwm42014-08-231-1/+5
| | | | | | | | | If duration<0, it means the duration is unknown. Disable framedropping, because end_time makes no sense in this case. Also, strictly never drop the first frame. This fixes weird behavior with the cover-art case (for the 100th time).
* player: restore silent seekingwm42014-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 846257da introduced an accidental feature: if you kept seeking (so playback never really resumes), the audio would never be played. This was nice, but commit 4c25b000 accidentally removed it again (due to the video_next_pts being earlier available than it used to be, so audio could be played before the player executed the next queued seek). Implicitly reintroduce the old behavior again by not decoding a second video frame immediately. Usually, the second frame is used to compute the frame duration needed to for accurate framedropping, but since the first frame after a seek is never dropped, we don't need this. Now the video code will queue the new frame to the VO immediately, and since fill_audio_out_buffers() is called in the playloop before write_video() and execute_queued_seek(), it never gets the chance to enter STATUS_READY, and seeks will be silent. This also has a nice side-effect: since the second frame is not decoded and filtered, seeking becomes slightly faster (back to the same level as with framedrop disabled). It seems this still sometimes plays a period of audio when keeping a seek key down. In my tests, this appeared to happen because the seek finished before the next key repeat was sent.
* audio: minor improvements to timeline switchingwm42014-08-234-13/+5
| | | | | | | | In theory, timestamps can be negative, so we shouldn't just return -1 as special value. Remove the separate code for clearing decode buffers; use the same code that is used for normal seek reset.
* demux_lavf: fix crash with unknown streamswm42014-08-231-1/+1
| | | | Could happen with DVD .vob files.
* osc: Use osd-font for playlist buttonsChrisK22014-08-221-2/+3
| | | | | Now that we use the symbols from the font, we should also actually use the font.
* player: some more debugging outputwm42014-08-221-0/+2
|
* video: some debugging outputwm42014-08-221-0/+4
|
* input.conf: bind ctrl+cwm42014-08-221-0/+1
| | | | | Just like I can terminate it on the terminal with this key combination, I want to be able to do the same on the X window.
* ao_dsound: raise default buffer size to 200ms, make it configurablewm42014-08-222-3/+8
|
* player: fix recent speed change regressionwm42014-08-223-2/+6
| | | | | | | | | | | | | | Commit 5afc025c broke this. The reason is that mpctx->delay is updated when a new video frame is added. This value is also needed to resync audio, but it will be for the wrong PTS. They must be consistent with each other, and if they aren't, initial sync will be off by N video frames, which results at least in worse user experience. This can be reproduced by for example heavily switching between normal and 2x speed, or similar. Fix by readding the video_next_pts field (keeping its use minimal, instead of reverting the commit that removed it).
* player: don't clobber playback position on video endwm42014-08-221-5/+3
| | | | | | | | If video reaches EOF, and audio is also EOF (or is otherwise not meaningful, like audio disabled), then the playback position was briefly set to 0. Fix this by not trying to use a bogus audio PTS. CC: @mpv-player/stable (maybe)
* video: refactor queue handlingwm42014-08-222-76/+53
| | | | | | | | | | | | | | | This simplifies the code, and fixes an odd bug: the second-last frame was displayed for a very short duration if framedrop was enabled. The reason was that basically the time difference between second-last and last frame were skipped, because at this point EOF was already signaled. Also see commit b0959488 for a similar issue in the same code. This removes the messiness of the next_frame 2-frame queue, and strictly runs the "new frame" code when a frame is moved to the first position of the queue, instead of somehow messing with return codes. This also merges update_video() into video_output_image().
* video: get rid of video_next_pts fieldwm42014-08-226-24/+8
| | | | | | Not really needed anymore. Code should be mostly equivalent. Also get rid of some other now-unused or outdated things.
* video: move some code aroundwm42014-08-221-46/+45
| | | | | | No functional changes. init_vo() is now needed a bit further down, and moving it keeps definition and use close. adjust_sync() will be used by a function further up in one of the following commits.
* video: minor simplificationwm42014-08-221-21/+11
| | | | This is mostly equivalent, but simpler, and reduces some duplication.
* manpage: remove duplicated contentBin Jin2014-08-221-29/+0
| | | | | | | Probably be accidentally added in b6b8bffd. CC: @mpv-player/stable Signed-off-by: wm4 <wm4@nowhere>
* vf_vapoursynth: add more VS frame propertiesBin Jin2014-08-221-0/+8
| | | | Add the missing frame properties in 48587e88.
* vf_vapoursynth: add display resolution supportBin Jin2014-08-221-0/+5
| | | | | | | | | | | | Add two new script environment variables 'video_in_dw' and 'video_in_dh', representing the display resolution of video. Along with video resolution, sample ratio aspect can be calculated in scripts. Currently it's impossible to change sample ratio aspect with single vapoursynth filter since '_SARNum' and '_SARDen' frame properties from output clip will be ignored. A following 'dsize' filter is necessary for this purpose.
* osc: revert disabling use_suspendwm42014-08-211-2/+0
| | | | It was an unintended/accidental change.
* build: disable terminfo and termcap code by defaultwm42014-08-212-2/+4
| | | | If nobody complains soon enough, I will remove the code completely.
* terminal-unix: new input handling codewm42014-08-211-33/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is independent of terminfo/termcap, and supports more keys. Originally, the goal was just extending the set of supported key sequences, but since the terminfo stuff actually makes this much harder, and since it's a big blob of bloated legacy crap, just drop it. Instead, use hardcoded tables. It's pretty easy to get on the same level as the old code (with fewer LOC), and we avoid additional error situations, such as mallocs which could fail (the old code just ignores malloc failures). We also try to support some xterm escape sequences, which are in relatively widespread use. (I'm not sure about the urxvt ones.) Trying to deal with xterm shift/ctrl/alt modifiers is probably a bit overcomplicated, and only deals with prefixes - xterm randomly uses prefix sequences for some keys, and suffixes for others (what the heck). Additionally, try to drop unknown escape codes. This basically relies on a trick: in almost 100% of all situations, a read() call will actually return complete sequences (possibly because of pipe semantics and atomic writes from the terminal emulator?), so it's easy to drop unknown sequences. This prevents that they trigger random key bindings as the code interprets the part after ESC as normal keys. This also drops the use of terminfo for sending smkx/rmkx. It seems even vt100 (to which virtually everything non-legacy is reasonably compatible with) supports the codes we hardcode, so it should be fine. This commit actually changes only the code if terminfo/termcap are not found. The next commit will make this code default.
* terminal-win: read input from a threadwm42014-08-212-29/+51
| | | | | | | | | Surprisingly, WaitFor* works on console handles. We can simply run the code for reading the console in a thread, and don't have to worry about crazy win32 crap in the rest of the player's input code anymore. This also fixes the issue that you couldn't unpause the player from the terminal, because the player would stop polling for input.
* terminal: some cleanupswm42014-08-215-72/+42
| | | | In particular, remove all the stupid debug printfs from the win code.
* terminal-win: remove nonsensical codewm42014-08-211-9/+0
| | | | | Something about a non-working MinGW thing? Really, I don't care. It also prevents using the console API properly.
* win32: emulate some ANSI terminal escape codeswm42014-08-215-53/+98
| | | | | | | | | | | | | | We already redirect all terminal output through our own wrappers (for the sake of UTF-8), so we might as well use it to handle ANSI escape codes. This also changes behavior on UNIX: we don't retrieve some escape codes per terminfo anymore, and just hardcode them. Every terminal should understand them. The advantage is that we can pretend to have a real terminal in the normal player code, and Windows atrocities are locked away in glue code.
* audio: limit on low (and not high) buffer sizewm42014-08-211-1/+1
| | | | | | | The original intention was probably to avoid unnecessarily high numbers of wakeups. Change it to wait at most 25% of buffer time instead of 75% until refilling. Might help with the dsound problems in issue #1024, but I don't know if success is guaranteed.
* vaapi: try dealing with Intel's braindamaged shit driverswm42014-08-217-2/+84
| | | | | | | | | | | | | | | | | | | | | | | | So talking to a certain Intel dev, it sounded like modern VA-API drivers are reasonable thread-safe. But apparently that is not the case. Not at all. So add approximate locking around all vaapi API calls. The problem appeared once we moved decoding and display to different threads. That means the "vaapi-copy" mode was unaffected, but decoding with vo_vaapi or vo_opengl lead to random crashes. Untested on real Intel hardware. With the vdpau emulation, it seems to work fine - but actually it worked fine even before this commit, because vdpau was written and designed not by morons, but competent people (vdpau is guaranteed to be fully thread-safe). There is some probability that this commit doesn't fix things entirely. One problem is that locking might not be complete. For one, libavcodec _also_ accesses vaapi, so we have to rely on our own guesses how and when lavc uses vaapi (since we disable multithreading when doing hw decoding, our guess should be relatively good, but it's still a lavc implementation detail). One other reason that this commit might not help is Intel's amazing potential to fuckup anything that is good and holy.
* osd+osc: Add left-arrow to osd-fontChrisK22014-08-212-2/+4
| | | | | For use as playlist navigation button in OSC, now the osd-font carries all symbols needed by the OSC.
* etc/mpv.desktop: add audio/flac mimetypewm42014-08-211-1/+1
| | | | | | Fixes #1025. CC: @mpv-player/stable
* video: don't assume query_format is thread-safewm42014-08-204-6/+19
| | | | Although it's probably safe for most VOs, there's no guarantee.
* terminal-unix: eliminate unnecessary variablewm42014-08-201-5/+2
|
* wayland: replace deprecated xkbcommon functionsAlexander Preisinger2014-08-201-3/+3
| | | | Available and stable since forever (xkbcommon 0.2).
* options.rst: fix warningAlexander Preisinger2014-08-201-1/+1
|
* vo_wayland: fix formatting inconsistenciesAlexander Preisinger2014-08-201-4/+4
|
* vo_wayand: save the flip time in the frame handlerAlexander Preisinger2014-08-201-0/+10
| | | | This value is more accurate than the default value.
* command: add estimated-frame-count & estimated-frame-number propertiesAndrey Morozov2014-08-192-0/+46
| | | | Signed-off-by: wm4 <wm4@nowhere>
* example.conf: demuxer-thread is now enabled by defaultwm42014-08-191-3/+2
| | | | Provide a more useful example instead.
* TOOLS/stats-conv.py: improvementswm42014-08-191-18/+31
| | | | This is still pretty useful for debugging timing-dependent things.
* video: add VOCTRL_GET_RECENT_FLIP_TIMEwm42014-08-182-1/+7
| | | | | | This could be used by VO implementations to report a recent vsync time to the generic VO code, which in turn will use it and the display FPS to estimate at which point in time the next vsync will happen.
* vo_opengl: add check-pattern suboption for testingwm42014-08-181-2/+28
| | | | | | | | | | | | | | | | This uses glXGetVideoSyncSGI() to check how many vsyncs happened since the last flip_page() call. It allows checking a pattern of vsync increments of at most 2 elements. For example, to check ~24 fps playback on a ~60 Hz monitor, this can be used: --vo=opengl:check-pattern=[3-2]:waitvsync Whether the reported results are accurate or just plain wrong may depend on the driver and if the waitvsync sub-option is used. There are no guarantees. This option is undocumented, and may be removed again in the near or distant future.
* video: dump vsync phase into stats file