summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Replace calls to usec_sleep()wm42013-05-2613-24/+15
| | | | | | This is just dumb sed replacement to mp_sleep_us(). Also remove the now unused usec_sleep() wrapper.
* Replace all calls to GetTimer()/GetTimerMS()wm42013-05-2619-125/+108
| | | | | | | | | | | | | | | | | | | | | | GetTimer() is generally replaced with mp_time_us(). Both calls return microseconds, but the latter uses int64_t, us defined to never wrap, and never returns 0 or negative values. GetTimerMS() has no direct replacement. Instead the other functions are used. For some code, switch to mp_time_sec(), which returns the time as double float value in seconds. The returned time is offset to program start time, so there is enough precision left to deliver microsecond resolution for at least 100 years. Unless it's casted to a float (or the CPU reduces precision), which is why we still use mp_time_us() out of paranoia in places where precision is clearly needed. Always switch to the correct time. The whole point of the new timer calls is that they don't wrap, and storing microseconds in unsigned int variables would negate this. In some cases, remove wrap-around handling for time values.
* vo: rip out VO timer wakeup mechanism againwm42013-05-263-31/+2
| | | | | | | This was used by some VOs to do timing of cursor autohiding, but we recently moved that out of the VOs. Even though this mechanism might be a good idea and could be needed again in future (but for what?), it's unused now. So better just get rid of it.
* timer: use gettimeofday() on Windowswm42013-05-261-1/+4
| | | | | | | MinGW-w64 emulates this via GetSystemTimeAsFileTime(), which has supposedly the best and most stable timer source out of most others. http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-crt/misc/gettimeofday.c
* timer: refactor, add 64 bit timer functionwm42013-05-267-102/+142
| | | | | | | | | | | | | | Make OS specific timer code export a mp_raw_time_us() function, and add generic implementations of GetTimer()/GetTimerMS() using this function. New mpv code is supposed to call mp_time_us() in situations where precision is absolutely needed, or mp_time_s() otherwise. Make it so that mp_time_us() will return a value near program start. We don't set it to 0 though to avoid confusion with relative vs. absolute time. Instead, pick an arbitrary offset. Move the test program in timer-darwin.c to timer.c, and modify it to work with the generic timer functions.
* cocoa_common: send mouse moved events to core when draggingStefano Pigozzi2013-05-261-2/+7
| | | | This change fixes mouse autohide when dragging mouse.
* wayland: use VOCTRL_SET_CURSOR_VISIBILITYAlexander Preisinger2013-05-262-36/+25
|
* wayland: introduce vo_wayland_configAlexander Preisinger2013-05-263-26/+24
| | | | | This removes the need for exposing vo_wayland_fullscreen and other functions also this will be usefull for other vos in the future.
* cocoa_common: implement VOCTRL_SET_CURSOR_VISIBILITYStefano Pigozzi2013-05-261-39/+20
| | | | Pass along cursor visibility hints to be more consistent with OSX's behaviour.
* cocoa_common: implement mouse movement notificationsStefano Pigozzi2013-05-261-0/+10
| | | | | | Notify the core of mouse movement events. The coordinates are converted to a coordinate system with the origin in upper left corner, since Cocoa has it in the lower left corner.
* w32: use VOCTRL_SET_CURSOR_VISIBILITYwm42013-05-261-6/+7
| | | | | This didn't even implement --cursor-autohide. Now it does, and the behavior of the VOs under Windows change accordingly.
* vo_sdl: use VOCTRL_SET_CURSOR_VISIBILITYwm42013-05-261-39/+3
|
* x11: remove cursor hiding logic, use VOCTRL_SET_CURSOR_VISIBILITYwm42013-05-262-48/+33
|
* core: do mouse cursor hiding business in frontendwm42013-05-266-7/+59
| | | | | Do this so that not every VO backend has to setup a timer for cursor hiding and interpret the --cursor-autohide option.
* vo: remove vo.check_events callbackwm42013-05-267-25/+8
| | | | | | Use VOCTRL_CHECK_EVENTS instead. Change the remaining VOs to use it. Only vo_sdl and vo_caca actually need this, and vo_null, vo_lavc, and vo_image had stubs only.
* w32: use vo_w32_control() for all VOswm42013-05-263-40/+15
|
* x11: use vo_x11_control() for all VOswm42013-05-265-80/+31
|
* video/out: introduce vo_control for gl_common based VOswm42013-05-2618-158/+138
| | | | | | | | | | | | | | | | Instead of having separate callbacks for each backend-handled feature (like MPGLContext.fullscreen, MPGLContext.border, etc.), pass the VOCTRL responsible for this directly to the backend. This allows removing a bunch of callbacks, that currently must be set even for optional/lesser features (like VOCTRL_BORDER). This requires changes to all VOs using gl_common, as well as all backends that support gl_common. Also introduce VOCTRL_CHECK_EVENTS. vo.check_events is now optional. VO backends can use VOCTRL_CHECK_EVENTS instead to implementing check_events. This has the advantage that the event handling code in VOs doesn't have to be duplicated if vo_control() is used.
* vf_lavfi: allow setting avoptswm42013-05-263-1/+22
|
* ao_alsa: always unset ALSA error handler, cleanup on init errorwm42013-05-261-8/+9
| | | | | | | | | | | | | | | | The ALSA device was not closed when initialization failed. The ALSA error handler (set with snd_lib_error_set_handler()) was not unset when closing ao_alsa. If this is not done, the handler will still be called when other libraries using ALSA cause errors, even though ao_alsa was long closed. Since these messages were prefixed with "[AO_ALSA]", they were misleading and implying ao_alsa was still used. For some reason, our error handler is still called even after doing snd_lib_error_set_handler(NULL), which should be impossible. Checking with the debuggers, inserting printf(), as well as the alsa-lib source code all suggest our error handler should not be called, but it still happens. It's a complete mystery.
* cocoa_common: authohide menu/dock in fullscreenStefano Pigozzi2013-05-261-2/+3
| | | | | This simple fix makes it possible to access the MainManu and Dock when in fullscreen when not using `--native-fs`.
* macosx_application: implement "Quit & remember position"Stefano Pigozzi2013-05-233-8/+21
| | | | | | | Add a menu item to quit and save the current playback position using the code added with commit ce9a854. Fixes #85
* af_lavfi: add libavfilter bridgewm42013-05-235-0/+352
| | | | | | | | | | | | | | | | | | | | | Mostly copied from vf_lavfi. The parts that could be shared are minor, because most code is about setting up audio and video, which are too different. This won't work with Libav. I used ffplay.c as guide, and noticed too late that their setup methods are incompatible with Libav's. Trying to make it work with both would be too much effort. The configure test for av_opt_set_int_list() should disable af_lavfi gracefully when compiling with Libav. Due to option parser chaos, you currently can't have a "," as part of the filter graph string - not even with quoting or escaping. This will probably be fixed later. The audio filter chain is not PTS aware. So we have to do some hacks to make up a fake PTS, and we have to map the output PTS back to the filter chain's method of tracking PTS changes and buffering, by adjusting af->delay.
* demux_mkv: defer reading of seek index until first seekwm42013-05-231-3/+42
| | | | | | | | | | | | | | | | | | | | | | Playing Youtube videos often requires an additional seek to the end of the file. This flushes the stream cache. The reason for the seek is reading the cues (seek index). This poses the question why Google is muxing its files in such a way, since nothing in Matroska mandates that cues are located at the end of the file, but we want to handle this situation better anyway. The seek index is not needed for normal playback, only for seeking. This commit changes header parsing such that the index is not read on initialization in order to avoid the additional stream-level seek. Instead, read the index on the first demuxer-level seek, when the seek index is actually needed. If the cues are at the beginning of the file, they are read immediately as part of the normal header reading process. This commit changes behavior only if cues are outside of the header (i.e. not in the area between EBML header and clusters), and linked by a SeekHead. Other level 1 elements linked by the SeekHead might still cause seeks to the end of the file, although that seems to be rare.
* demux_mkv: use a single flag to indicate whether cues have been readwm42013-05-231-1/+3
| | | | | | | | | | | | Before this commit, the demuxer would in theory accept multiple cues elements (and append its contents to the index in the order as encountered during reading). According to the Matroska specification, there can be only one cues element in the segment, so this seems like an overcomplication. Change it so that redundant elements are ignored, like with all other unique header elements. This makes implementing deferred reading of the cues element easier.
* command: auto-insert yadif when switching deinterlacingwm42013-05-231-6/+40
| | | | | | | | | | | | | | | | | | | | | | | If VO deinterlacing is unavailable, try to insert vf_yadif. If vf_lavfi is available, actually use vf_yadif from libavfilter. The libavfilter version of this filter is faster, more correct, etc., so it is preferred. Unfortunately vf_yadif obviously doesn't support VFCTRL_GET/SET_DEINTERLACE, and with the current state of the libavfilter API, it doesn't look like there is any simple way to emulate it. Instead, we simply insert the filter with a specific label, and if deinterlacing is to be disabled, the filter is removed again by label. This won't do the right thing if the user inserts any deinterlacing filter manually (except native vf_yadif, which understands the VFCTRL). For example, with '-vf lavfi=yadif', pressing 'D' (toggle deinterlacing) will just insert a second deinterlacer filter. In these cases, the user is supposed to map a command that toggles his own filter instead of using 'D' and the deinterlace property. The same applies if the user wants to pass different parameters to the deinterlacer filters.
* m_option: allow removing filter entries by content with -vf-delwm42013-05-231-89/+88
| | | | | | | | | | | | | | If a complete filter description is passed to -vf-del, search for an existing filter with the same label or the same name/arguments, and delete it. The rules for filter entry equality are the same as with the -vf-toggle option. E.g. -vf-add gradfun=123:gradfun=456 -vf-del gradfun=456 does what you would expect.
* m_option: move code aroundwm42013-05-231-139/+146
| | | | Move the helper functions for parsing -vf, and rename some.
* m_option, vf: add label supportwm42013-05-235-26/+106
| | | | | | | | | | | | | | | | | Can be used to refer to filters by name. Intended to be used when the filter chain is changed at runtime. A label can be assigned to a filter by prefixing it with '@name:', where 'name' is an user-chosen identifier. For example, a filter added with '-vf-add @label1:gradfun=123' can be removed with '-vf-del @label1'. If a filter with an already existing label is added, the existing filter is replaced with the new filter (this happens for both -vf-add and -vf-pre). If a filter is replaced, the new filter takes the position of the old filter, instead of being appended/prepended to the filter chain as usual. For -vf-toggle, labels are compared if at least one of the filters has a label; otherwise they are compared by filter name and arguments (like before). This means two filters are never considered equal if one has a label and the other one does not.
* core: support mpv directory itself as a valid location for config files on ↵elevengu2013-05-231-9/+22
| | | | | | | | | | Windows This prefers ./ on Windows if-and-only-if the file being searched for already exists there. (If the mpv directory is non-writable, the result is still intended behavior.) This change is transparent to most users because the user has to move the config files there intentionally, and if anything, not being detected would be the surprising behavior.
* vo: remove unused callbackwm42013-05-231-1/+0
|
* mplayer: don't cut status line if --no-consolecontrols is usedwm42013-05-211-1/+4
|
* demux_lavf: workaround minor ffmpeg memory leakwm42013-05-212-7/+1
| | | | | | | | | | | | The sequence of avcodec_alloc_context3() / avcodec_copy_context() / avcodec_close() / av_free() leaks some memory. So don't copy the context and use it directly. Originally avcodec_copy_context() was used to guarantee that libavformat can't update the fields of the context during demuxing in order to make things a little more robust, but it's not strictly needed, and ffmpeg/ffplay don't do this anyway. Still might make the situation worse should we move demuxing into a separate thread, though.
* demux: workaround for -demuxer mpegts -correct-ptswm42013-05-212-8/+16
| | | | | | | | | | | | | | | | | | | | | | Using -demuxer mpegts -correct-pts triggered the assertion in ds_get_packet2(). This is not surprising, because the correct-pts code was changed to accept _complete_ packets, while all the old demuxers (including the mpegts demuxer) require you to use "partial" packet reads, together with the video_read_frame(). (That function actually parses video frames, so fragments of the original "packets" can be fed to the decoder.) However, it returns out demux_ts packet's are mostly useable. demux_ts still adds an offset (i.e. ds->buffer_pos != 0) to the packets when calling internal parser functions, such as in parse_es.c. While this is unclean design due to mplayer's old video demuxing/decoding path, it can be easily be made work by modifying the packet as returned by ds_get_packet2(). We also have to change the packet freeing code, as demux_packet->buffer doesn't have to point to the start of the memory allocation anymore. MPlayer handles this "correctly" because it doesn't have a function that reads a complete packet.
* demux_mkv: support dirac in mkvwm42013-05-212-0/+2
| | | | | | | | | | | | | | Nobody uses this, and this is an absolute waste of time. Even the user who reported this turned out to have produced a sample manually. Sample produced with: wget http://diracvideo.org/download/test-streams/raw/vts/vts.LD-8Mb.drc mkvmerge -o dirac.mkv vts.LD-8Mb.drc mkvmerge writes a sort of broken aspect ratio. libavformat interprets it as 1:1 PAR, while demux_mkv thinks this is a 1:1 DAR. Maybe libavformat is more correct here.
* options: remove dead -dr1 optionwm42013-05-212-3/+0
|
* dec_video: get rid of two global variableswm42013-05-216-13/+9
|
* dec_video: remove emms usagewm42013-05-211-10/+0
| | | | | | | libavcodec generally shouldn't have this problem anymore (if libavcodec ever had it). All other video decoders are gone. In any case, if this commit actually causes regressions, these are libavcodec bugs and should be fixed there instead.
* mplayer: re-add some legacy slave mode output for issue #92wm42013-05-211-5/+15
| | | | | | In the long run this should be done differently. ID_... output sucks. This commit will be reverted as soon as I have a good idea how this should be done properly.
* configure: map --enable-sdl2 to autodetectionStephen Hutchinson2013-05-211-2/+2
| | | | | | | | | | | | | Commit 02bbd87b disabled SDL linking by default. This commit followed the ancient mplayer convention of disabling detection of compiler flags with --enable-* switches. Unfortunately, this makes compiling with SDL enabled a pain. Make --enable-sdl/sdl2 use autodetection, even if it's inconsistent with most other --enable-* switches. The same is already done for --enable-openal, though. Based on a pull request by qyot27.
* vf_lavfi: remove redundant statementswm42013-05-211-4/+0
|
* m_option: fix parameter comparison for vf-togglewm42013-05-211-6/+11
| | | | | | The vf-toggle option parsing (normally used for runtime video filter switching only) was missing comparing the parameter values. Fix this, and also make the code a bit more robust.
* m_option: fix -vf-del in profileswm42013-05-211-3/+4
| | | | | We don't bother with option verification (as it happens in profiles), because it's barely possible.
* Silence some compiler warningswm42013-05-215-13/+12
| | | | None of these were actual issues.
* travis: fix typoStefano Pigozzi2013-05-201-1/+1
| | | | [ci skip]
* travis: DRY up the yaml fileStefano Pigozzi2013-05-201-6/+6
| | | | | Use YAML's anchor/reference syntax to DRY up the YAML file. Also fix a bug that caused the IRC notification to always take place (even on success).
* vf_dlopen framestep: step width of 0Rudolf Polzer2013-05-201-0/+2
| | | | | This is now defined to mean to never output any frame again (except for the first).
* vf_dlopen framestep filter: add a parameter for the phaseRudolf Polzer2013-05-201-4/+9
| | | | | also, default to 0-indexed frame counts (so by default, the 1st frame is output). Old behaviour can be done by -vf dlopen=./framestep.so:42:41.
* add Travis-CI integrationStefano Pigozzi2013-05-193-19/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Travis-CI [1] is a continous integration cloud service. It is free for open-source projects and tigthly integrated tiwh GitHub so there is really no reason for us not use it. :) For now we are going to do a total of 4 builds, mainly to test ffmpeg/libav API breakage: * ffmpeg-stable, libass-stable * ffmpeg-git, libass-stable * libav-stable, libass-stable * libav-git, libass-stable The compiler that is currently used is clang for two reasons: * running 8 build targets would be quite wasteful and take a long time * clang is less tested and used during development than gcc (especially on linux) Currently Travis doesn't support OS X environments alongside Linux ones [2]. When it will, we will add a fifth build target to test OS X compilation breakage. README was moved to markdown to add the little build status image. I ran some tests with my GitHub fork and couldn't get images to show up using ReStructured Text. [1]: https://github.com/travis-ci/travis-ci [2]: travis-ci/travis-ci#216
* configure: reject older libswresamplewm42013-05-191-2/+2
| | | | | | | | | | | mpv still builds with ffmpeg 1.0.x, however libswresample keeps cuasing trouble. In older releases, libswresample simply crashed when downmixing. In somewhat newer versions, it produces distorted output and downmixing isn't even close to correct. With ffmpeg release 1.1 (ffmpeg git tag n1.1), everything seems to work fine. The release uses 0.17.102 as libswresample version, so bump the required minimum version to that.
* Fix commit d1b37afwm42013-05-181-1/+1
| | | | Yeah, it doesn't work this way... Please look away.
* vo_image: start image file numbers at 1wm42013-05-181-2/+2
| | | | Requested by a user.
* input: allow quotes around any input commandwm42013-05-181-3/+1
|
* input: do property expansion for all input command string argumentswm42013-05-185-21/+33
| | | | | | Also add a "raw" prefix for commands, which prevents property expansion. The idea is that if the commands are generated by a program, it doesn't have to know whether the command expands properties or not.
* input: accept input command prefixes in any orderwm42013-05-181-20/+22
| | | | | | | | | | This is more consistent, and doesn't bother the user with ordering rules when new prefixes are added. Will break obscure uses of legacy commands: if the command is supposed to be translated by the legacy command bridge, and if that command uses one of the pausing* prefixes, the command can't be parsed. Well, just use the new commands in this case.
* video/filter: fix option parser memory leakwm42013-05-186-16/+3
| | | | | | | This happens only if an option actually allocates memory (like strings). Change filter API such that vf->priv is free'd by vf.c instead by the filters. vf.c will free the option values as well.
* core: allow changing filter filters at runtimewm42013-05-187-12/+112
| | | | | | | | | | | | | | | | Add the "vf" command, which allows changing the video filter chain at runtime. For example, the 'y' key could be bound to toggle deinterlacing by adding 'y vf toggle yadif' to the input.conf. Reconfiguring the video filter chain normally resets the VO, so that it will be "stuck" until a new video frame is rendered. To mitigate this, a seek to the current position is issued when the filter chain is changed. This is done only if playback is paused, because normal playback will show an actual new frame quickly enough. If vdpau hardware decoding is used, filter insertion (whether it fails or not) will break the video for a while. This is because vo_vdpau resets decoding related things on vo_config().
* m_option: allow -vf ""wm42013-05-181-5/+3
| | | | | | | With the current semantics, there's no reason to disallow this. (Although in my opinion, -vf should rather map to -vf-add than -vf-set, however that is an independent issue from this change.)
* m_option: add -vf-togglewm42013-05-181-52/+80
| | | | | | | | Works like -vf-add, except if a filter already exists and has the same parameters, it's removed instead of added. Not really useful on the command line itself, but will make sense for runtime filter changing in the following commit.
* m_option: allo