summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* vo_vdpau: Ensure presentation time is within boundsJonas Zetterberg2014-02-101-0/+4
| | | | | When a time sync happens the last sync time is the minimum time that can be used for presentation.
* Merge branch 'client_api'wm42014-02-1029-375/+2686
|\
| * Add a client API examplewm42014-02-104-0/+69
| |
| * build: add option to build a librarywm42014-02-106-12/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | This library will export the client API functions. Note that this doesn't allow compiling the command line player to link against this library yet. The reason is that there's lots of weird stuff required to setup the execution environment (mostly Windows and OSX specifics), as well as things which are out of scope of the client API and every application has to do on its own. However, since the mpv command line player basically reuses functions from the mpv core to implement these things, it's not very easy to separate the command line player form the mpv core.
| * build: include a copy of syms.py from upstream wafwm42014-02-101-0/+81
| | | | | | | | | | | | The alternatives to copying this small bit of code are even worse. This is unmodified, except for the added line 3.
| * lua: add a timer APIwm42014-02-101-10/+79
| |
| * lua: port to client APIwm42014-02-1010-224/+242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is partial only, and it still accesses some MPContext internals. Specifically, chapter and track lists are still read directly, and OSD access is special-cased too. The OSC seems to work fine, except using the fast-forward/backward buttons. These buttons behave differently, because the OSC code had certain assumptions how often its update code is called. The Lua interface changes slightly. Note that this has the odd property that Lua script and video start at the same time, asynchronously. If this becomes an issue, explicit synchronization could be added.
| * Add a client APIwm42014-02-1011-118/+1867
| | | | | | | | | | | | | | Add a client API, which is intended to be a stable API to get some rough control over the player. Basically, it reflects what can be done with input.conf commands or the old slavemode. It will replace the old slavemode (and enable the implementation of a new slave protocol).
| * timer: init only oncewm42014-02-103-7/+18
| | | | | | | | | | | | | | | | | | | | This avoids trouble if another mpv instance is initialized in the same process. Since timeBeginPeriod/timeEndPeriod are hereby not easily matched anymore, use an atexit() handler to call timeEndPeriod, so that we can be sure these calls are matched, even if we allow multiple initializations later when introducing the client API.
| * options: add --no-terminal switchwm42014-02-108-30/+60
| | | | | | | | | | Mostly useful for internal reasons. This code will be enabled by default if mpv is started via the client API.
| * threads: add a dispatch queue thingwm42014-02-102-0/+250
| | | | | | | | | | | | Makes working with the (still) single-threaded playback thread easier. Might be reusable for other stuff.
| * threads: avoid timeout calculation overflowwm42014-02-101-0/+3
|/ | | | | | | | | It's quite possible to overflow the calculation by setting the timeout to high values. Limit it to INT_MAX, which should be safe. The issue is mainly the secs variable. timespec.tv_sec will normally be 64 bit on sane systems, and we assume it can't overflow by adding INT_MAX to it.
* demux_mkv: remove weird seeking semantics for audiowm42014-02-091-6/+1
| | | | | | | | | | | | This skipped all audio packets before the first video key frame was found. I'm not really sure why this would be needed; most likely it isn't. So get rid of it. Even if audio packets are returned to the player too soon, the player will sync the audio start to the video start by decoding and discarding audio data. Note that although the removed code was just added in the previous commit, it merely kept the old keeping semantics which demux_mkv always followed. This commit removes these special semantics.
* demux_mkv: improve audio-only seekingwm42014-02-091-5/+8
| | | | | | | | | | | | | | | | v_skip_to_keyframe is set to true while non-keyframe video packets are skipped. Until now, audio packets were also skipped when doing this. I can't see any good reason why this would be done, but for now I want to keep the old logic when audio+video seeks are done. However, for audio-only mode, do proper seeking, which also fixes behavior when trying to seek past the end of the file: playback is terminated properly, instead of starting playback on the start of the last cluster. Note that a_no_timecode_check is used only for audio+video seek. I'm not sure what this is needed for, but it might influence A/V sync after seeking.
* demux: fix some newlines in output messageswm42014-02-091-2/+2
|
* player: fix an assert when reinitializing audio in some caseswm42014-02-091-0/+3
| | | | | | | | This sometimes happened when changing playback speed (= reinitializing audio) after seeking of playback start. The assertion in audio.c:441 was triggered, because buffer_playable_samples wasn't reset correctly when the audio buffer was cleared or shortened. The assertion is correct and should hold up any time.
* vo_opengl: use exactly the values defined by BT.709 for CMSnand2014-02-091-3/+9
| | | | | | I could not see any difference whatsoever, but for usage with a 3DLUT there's zero performance difference so we might as well follow the spec to the letter.
* msg: clear lines by printing spaces on MS Windowswm42014-02-091-1/+7
| | | | | | | | | | | | | | | On Windows, no ANSI control sequences are available, so we can't easily clear lines, move the cursor, etc. It's yet to be decided how this should be handled (emulate ANSI escapes in osdep/terminal-win.c, or provide abstracted terminal API functions to unify the Linux and Windows code). For now, this fixes the regression that was introduced earlier by the status line rewrite. It doesn't fix all aspects of status line and terminal OSD handling, as can be clearly seen by the unconditional use of terminal_erase_to_end_of_line further down the changed code. Fixes github issue #499 (sort of).
* demux_lavf: work around idiotic libavutil API printing a warningwm42014-02-081-1/+5
| | | | | | | | | | Trying to set a non-existent flag (like +keepside on Libav) causes libavutil print an incomprehensible warning (something about eval; probably the overengineered libavutil option parser tripping over the '+' normally used for flags, and trying to interpret it as formula). There's apparently no easy way to check for the existence of a flag, so add some more ifdeffery to shut it up.
* player: handle seek delays differentlywm42014-02-075-25/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code removed from handle_input_and_seek_coalesce() did two things: 1. If there's a queued seek, stop accepting non-seek commands, and delay them to the next playloop iteration. 2. If a seek is executing (i.e. the seek was unqueued, and now it's trying to decode and display the first video frame), stop accepting seek commands (and in fact all commands that were queued after the first seek command). This logic is disabled if seeking started longer than 300ms ago. (To avoid starvation.) I'm not sure why 1. would be needed. It's still possible that a command immediately executed after a seek command sees a "seeking in progress" state, because it affects queued seeks only, and not seeks in progress. Drop this code, since it can easily lead to input starvation, and I'm not aware of any disadvantages. The logic in 2. is good to make seeking behave much better, as it guarantees that the video display is updated frequently. Keep the core idea, but implement it differently. Now this logic is applied to seeks only. Commands after the seek can execute freely, and like with 1., I don't see a reason why they couldn't. However, in some cases, seeks are supposed to be executed instantly, so queue_seek() needs an additional parameter to signal the need for immediate update. One nice thing is that commands like sub_seek automatically profit from the seek delay logic. On the other hand, hitting chapter seek multiple times still does not update the video on chapter boundaries (as it should be). Note that the main goal of this commit is actually simplification of the input processing logic and to allow all commands to be executed immediately.
* gl_x11: don't require a X visual for modern GL context creationwm42014-02-061-4/+10
| | | | | | | | Legacy GL context creation (glXCreateContext) explicitly requires a X visual, while the modern one (glXCreateContextAttribsARB) does not for some reason. So fail only on the legacy code path if we don't find a visual. Note that vo_x11_config_vo_window() will select a default visual if a NULL visual is passed to it.
* gl_x11: always request true color visualwm42014-02-061-0/+1
| | | | | | | | | | | | | | | | | | This fixes issue #504. For some reason, glXChooseFBConfig() will return a fbconfig with no associated visual. (I'm not sure if this allowed. They don't always have a visual, but since GLX_X_RENDERABLE is set and GLX_DRAWABLE_TYPE is (implicitly) set to GLX_WINDOW_BIT, why would there be no visual?) Even worse, a test program seems to show that a 16 bit fbconfig is selected (instead of 24/32 bit), which doesn't sound nice at all. Since there _are_ better fbconfigs available, glXChooseFBConfig() should normally sort them by quality, and return the better ones first. It's worth noting that this function should also prefer GLX_TRUE_COLOR over anything else, although this comes last in the sort order. Whatever is going on, requesting GLX_X_VISUAL_TYPE with GLX_TRUE_COLOR seems to fix it.
* demux_lavf: do metadata-from-packet update before possibly discarding itwm42014-02-061-2/+1
| | | | | | | | | | | | There is some logic to discard packets from streams that are not selected. Run the metadata update code before this, just to make 100% sure that no metadata updates can be lost when streams are deselected. (I'm not sure why this logic would be needed, since both libavformat and the generic demuxer code do this already. But a quick test shows that av_read_frame() can return a packet from a stream even if the stream has AVStream.discard set to AVDISCARD_ALL. This happened after stream switching. Maybe libavformat doesn't discard already queued packets.)
* demux_lavf: don't check for error when setting "keepside" flagwm42014-02-061-4/+1
| | | | | This flag doesn't exist on Libav (because they never do this insane packet merging stuff), so this would print unnecessary warnings there.
* DOCS/waf-buildsystem: add link to the Waf bookTimothy Gu2014-02-061-1/+1
|
* DOCS/crosscompile-mingw: use MarkdownTimothy Gu2014-02-061-1/+6
|
* DOCS/crosscompile-mingw: updateTimothy Gu2014-02-061-4/+0
| | | | MXE's ffmpeg is not old anymore.
* demux: reword "Clip info:" line to "File tags:"wm42014-02-061-1/+1
|
* demux: fill metadata directly, instead of using wrapper functionswm42014-02-064-57/+26
| | | | | | Get rid of demux_info_add[_bstr] and demuxer_add_chapter_info. Make demuxer_add_chapter_info return the chapter index for convenience.
* demux_lavf: clear metadata on update, instead of merging itwm42014-02-063-0/+8
| | | | | Assume a metadata update is a full update. Clear the previous metadata, so that tags which existed only in the previous metadata are removed.
* demux: handle tag updates differentlywm42014-02-063-15/+21
| | | | | | | | | | | | | | | | Instead of printing lines like: Demuxer info GENRE changed to Alternative Rock Just output all tags once they change. The assumption is that individual tags rarely change, while all tags change in the common case. This changes tag updates to use polling. This could be fixed later, although the ICY stuff makes it a bit painful, so maybe it will remain this way. Also remove DEMUXER_CTRL_UPDATE_INFO. This was intended to check for tag updates, but now we use a different approach.
* stream_lavf: prefix icy metadata with "icy-"wm42014-02-061-1/+1
| | | | | ICY metadata is not always of good quality, and especially if there are proper tags. We don't want the ICY metadata override the tags.
* demux_lavf: get updated metadata from a packet if availableBen Boeckel2014-02-063-0/+43
| | | | The side_data type is brand new in ffmpeg.
* umpv: silence mpv terminal outputwm42014-02-051-2/+4
| | | | | Now it does basically the same as mkv.desktop. Explanation is included in the description comment.
* umpv: improve descriptionwm42014-02-051-9/+11
|
* umpv: use --force-windowwm42014-02-051-4/+2
| | | | This makes it show a window even when playing audio-only files.
* audio: fix signedness of AF_FORMAT_S32Pwm42014-02-051-1/+1
| | | | This was marked as unsigned, but it's signed. Found by xylosper.
* io: make MP_PATH_MAX private to win32 codewm42014-02-032-12/+10
| | | | | The win32 code is the only thing which actually needs this (and it's used to make emulation of UTF-8 filename APIs easier).
* mf: don't limit filename length with PATH_MAXwm42014-02-031-3/+3
| | | | | | | | Use an arbitrary constant instead, which is as good as PATH_MAX. This helps us to avoid having to think about pull request #523. Also fix a case where a potentially signed char was passed to isspace().
* player: refresh OSD on track switchingwm42014-02-031-0/+2
| | | | Apparently, at least sub_reload was missing a refresh at all.
* command: output more information in colorspace properties and simplifywm42014-02-031-39/+31
| | | | | Instead of trying to be clever to avoid outputting redundant information, simply output everything that we have.
* csputils: correct constness of csp name constantswm42014-02-032-6/+6
|
* wayland: change minimum versionAlexander Preisinger2014-02-022-11/+2
| | | | | Change minimum version to 1.3 and remove the version checking in the source code.
* x11: fix initial VO sizewm42014-02-021-6/+7
| | | | | | | This was done incorrectly in the previous commit: the fallback size used the window size as requested with the first config call, which is the size of the hidden window in the vo_opengl case. (That damn hidden window again...)
* x11: remove apparently useless codewm42014-02-021-8/+0
| | | | | | | | | This code essentially does nothing. As far as I could find out, this actually used to do something. Then it was removed with commit efe7c39f, leaving some leftover code that didn't do anything useful. This happened 12 years ago! Also remove a commented debug printf.
* x11: fix race condition when setting aspect when leaving fullscreenwm42014-02-021-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | vo_opengl creates a hidden X11 window to probe the OpenGL context. It must do that before creating a visible window, because VO creation and VO config are separate phases. There's a race condition involving the hidden window: when starting with --fs, and then leaving fullscreen, the unfullscreened window is sometimes set to the aspect ratio of the hidden window. I'm not sure why the window size itself uses the correct size (but corrupted by the wrong aspect), but that's perhaps because the window manager is free to ignore the size hint while honoring the aspect, or something equally messed up. It turns out this happens because x11_common.c thinks the size of the hidden window is the size of the unfullscreened window. This in turn happens because vo_x11_update_geometry() reads the size of the hidden window when called in vo_x11_fullscreen() (called from vo_x11_config_vo_window()) when mapping the fullscreen window. At that point, the window could be mapped, but not necessarily. If it's not mapped, it will get the size of the unfullscreened window... I think. One could fix this by actively waiting until the window is mapped. Try to pick a less hacky approach instead, and never read the window size until MapNotify is received. vo_x11_create_window() needs a hack, because we'd possibly set the VO's size to 0, resulting e.g. in vdpau to fail initialization. (It'll print error messages until a proper resize is received.)
* old-configure: use -std=c99wm42014-02-021-2/+2
| | | | See previous commit.
* build: switch to -std=c99 for saner float semanticswm42014-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | This fixes a weird bug with aspect ratio handling. It has to do with float handling: with -std=gnu99, gcc implicitly enables broken non- standard semantics giving float variables excess precision. This can for example make this fail in theory: "float a = 0.1; assert(a == a);" While standard C allows excess precision _within_ expressions, it requires truncation when storing float values in variables of types "float" or "double". The "gnu99" mode breaks this. It can be unbroken by using "c99", or by specifying -fexcess-precision=standard. The former seems less likely to break compilers other than modern gcc. Note that -ffloat-store would also fix this, but also makes float expressions less efficient and less precise for no reason. The code that mistakenly fails because of this is dec_video.c line 393. It caused the container aspect to be ignored in some or all situations, depending how the compiler optimizes. For example, on gcc-4.6 with -Os, the aspect is always ignored. In future, we should probably just get rid of storing aspects as floats.
* cache: refuse to seek outside of cache boundarieswm42014-01-311-4/+18
| | | | | | | | | | | | | | | | | Note that this still happens in the stream level, so we can't have nice highlevel behavior restricting seeking. Instead, if a seek leads to the demuxer requesting data outside of the cached range, the seek will simply fail. This might confuse the demuxer, and the resulting behavior is not necessarily useful. Note that this also doesn't try to skip data on a forward seek. This would just freeze the stream with slow unseekable streams. One nice thing is that stream.h has a separate function for merely skipping data (separate from seeking forward), which is pretty useful in this case: we want skipping of data to work, even if we reject seeking forward by skipping data as too expensive. This probably is or will be useful for demux_mkv.c.
* threads: add function to calculate deadline for timed waitswm42014-01-312-3/+14
| | | | | | | | | | | | Usually, you have to call pthread_cond_timedwait() in a loop (because it can wake up sporadically). If this function is used by another higher level function, which uses a relative timeout, we actually have to reduce the timeout on each iteration - or, simpler, compute the "deadline" at the beginning of the function, and always pass the same absolute time to the waiting function. Might be unsafe if the system time is changed. On the other hand, this is a fundamental race condition with these APIs.
* threads: add wrapper for initializing recursive mutexeswm42014-01-314-10/+17
| | | | Damn this overly verbose pthread API.
* demux_mkv: remove unused fieldwm42014-01-311-4/+0
|
* demux_lavf: fix crash with empty fileswm42014-01-311-1/+1
| | | | | | | | | | This used to work; I'm not sure when or why it regressed. When setting AVProbeData.filename to NULL, libavformat will crash in rtp_probe() by unconditionally accessing the string. We used to set the filename to NULL to prevent probing by file extension when we don't deem it as necessary. Using an empty string also works for this purpose.
* quvi: disable subtitle fetching by defaultwm42014-01-312-5/+7
| | | | This is slow and unreliable, basically unusable.
* options: alternative way to specify color optionswm42014-01-312-12/+65
| | | | | | | | | | | | | | | | Try to make it more intuitive by not requiring hex values. The new way uses float values in the range 0.0-1.0, separated by '/' (':' was suggested, but that wouldn't allow color options in sub-options). Example: --osd-color=1.0/0.0/0.0/0.75 Using the range 0.0-1.0 has the advantage that it could be easily extended to colors beyond 8 bit. Details see manpage. Suggestions for alternative syntax or value ranges are welcome, but be quick with it.
* vo_wayland: silence shadowing warningwm42014-01-291-3/+3
| | | | No real problem.
* msg: don't clear the status line if new and previous status was emptywm42014-01-291-0/+3
| | | | | | | | | | | | | This avoids stray newlines when: 1. Some (non-status line) text was output 2. Then an empty status line is output According to the logic, 2. should print an empty line to show the blank status line. Don't do that, and instead output nothing in this case. This caused problems with mpv_identify.sh, and also looked ugly when using --quiet.
* mp_image: reject too large image sizeswm42014-01-291-0/+4
| | | | | | | | | | |