summaryrefslogtreecommitdiffstats
path: root/mpvcore
Commit message (Collapse)AuthorAgeFilesLines
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-1732-5540/+0
|
* Merge mp_talloc.h into ta/ta_talloc.hwm42013-12-173-61/+2
|
* Move options/config related files from mpvcore/ to options/wm42013-12-1717-6751/+3
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* Move libquvi stuff to stream/resolve/wm42013-12-173-321/+0
|
* Move mpvcore/input/ to input/wm42013-12-177-3458/+0
|
* Rename mp_core.h to core.hwm42013-12-171-1/+1
| | | | Get rid of the mp_ prefix.
* Move mpvcore/player/ to player/wm42013-12-1723-13324/+0
|
* Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsgwm42013-12-1615-81/+67
| | | | | | | | | The tmsg stuff was for the internal gettext() based translation system, which nobody ever attempted to use and thus was removed. mp_gtext() and set_osd_tmsg() were also for this. mp_dbg was once enabled in debug mode only, but since we have log level for enabling debug messages, it seems utterly useless.
* input: remove LIRCCD supportwm42013-12-162-14/+0
| | | | | | | This removes support for the "LIRC Client Daemon", which is separate from LIRC, and hasn't been maintained for 10 years. See github issue #413.
* command: mess with previous commitwm42013-12-161-11/+9
| | | | | | Nothing actually used the returned length. Since the remaining time can easily become 0 or negative (e.g. incorrectly estimated file duration), the time_remaining function still needs 2 return values, though.
* command: scale osd’s time remaining by the current speedVivek Jain2013-12-162-6/+28
| | | | Signed-off-by: wm4 <wm4@nowhere>
* input: move multi-command parsing somewhere elsewm42013-12-161-32/+38
| | | | | I'm planning to add a mode to pass commands as a pre-split list of strings, and this will probably be useful to reach this goal.
* input: adjust code to make quoted/not quoted cases more unifiedwm42013-12-161-8/+11
|
* input: better error reporting for missing commandswm42013-12-161-7/+12
| | | | Don't print an empty string if the command is missing.
* input: move some command flags into a bitfieldwm42013-12-163-49/+49
|
* input: remove weird syntax for skipping optional argumentswm42013-12-161-10/+4
|
* input: avoid using wakeup pipe if it's not neededwm42013-12-161-1/+9
| | | | | | | | | | | | | | If input is not waiting for select(), writing to the wakeup pipe is wasteful, and, if there are many wakeups, might even block the wakeup threads if the pipe gets full. However, if it's waiting for select(), the wakup pipe must be used to unblock the waiting thread. Actually there's a small race condition: we might determine that the main thread is in select(), and write to the wakeup pipe (whether we do this while unlocked or locked doesn't really matter). Then, the main thread might leave select() before reading from the wakup pipe. This should be harmless, because at worst more wakeups than needed happen, but never fewer.
* mp_msg: define a bunch of convenience macroswm42013-12-161-0/+8
| | | | | | | | | In order to use bare mp_log contexts, I find myself creating dummy structs (with a single "log" field) to use the MP_ERR() etc. macros, which hardcode the idiom that a context struct has a log field. On the other hand, just using mp_msg_log() is too much typing (and I want to rename it to mp_msg() when the transition is done), so it seems nice to have message printing macros that use mp_log directly.
* input: don't quit with exit status 1 when receiving SIGTERMwm42013-12-151-1/+1
| | | | | Instead, do whatever the normal "quit" command does, which currently is returning a status of 0.
* player: don't temporarily disable terminal handling when reloading fileswm42013-12-153-20/+11
| | | | | | | | | | There's no reason why we should do this. For some reason, the existing code reset terminal handling to default after unloading a file, just to initialize it again when loading a new file. Might be related to github issue #412, although I don't think it helps, since the default SIGTERM handler _should_ kill the mpv process. (It's still a nice simplification, though.)
* player: don't store subtitle renderer in osd_statewm42013-12-154-12/+14
| | | | | | | | This doesn't have much value. It can't be accessed by anything else than the actual subtitle renderer (sd_ass.c). sd_ass.c could create the renderer itself, except that we apparently want to save memory (and some font loading time) when using ordered chapters or multiple subtitle tracks.
* dvdnav: fix incorrect clipping of highlightswm42013-12-151-6/+6
|
* matroska: add --ordered-chapters-files optionwm42013-12-143-2/+18
| | | | | This option takes a playlist. The playlist will then be used as list of potential segment files for use with ordered chapters.
* Allow some options taking filenames to refer to mpv config dirwm42013-12-144-9/+47
| | | | | | | | | | Add the mp_get_user_path() function, and make it expand special path prefixes. Use it for some things in mpv which take filenames (--input-config, --screenshot-template, opengl icc-profile suboption). This allows accessing files in the mpv config dir without hardcoding the config path by prefixing the path with ~~/. Details see manpage additions.
* dvdnav: crappy hack to respect timed still frameswm42013-12-141-1/+24
| | | | | | Before this, they were displayed forever. Since some dvd screens seem not to allow escaping from the still frame using the menu, this could get you stuck forever.
* dvdnav: block when libdvdnav requests draining bufferswm42013-12-141-5/+13
| | | | | | | | | | | Not sure how this should work. Using libdvdnav with a large FIFO doesn't make sense either: data and control commands use the same stream, so if you want to send input to libdvdnav, you just have to read from libdvdnav all the time to get a reaction, which is not compatible with maintaining a buffer that could remain full for a long time. I have no idea either whether this improves or worsens anything, though it might be more correct.
* dvdnav: improve a commentwm42013-12-131-1/+1
|
* dvb: prevent seek when reopening the demuxerwm42013-12-131-1/+3
| | | | | | Since dvb input is not seekable anyway, this would probably just flush the stream buffer, but at least it'll avoid a bogus message about seeking errors.
* dvdnav: support mouse interactionwm42013-12-131-3/+16
|
* Add prelimimary (basic, possibly broken) dvdnav supportwm42013-12-1210-23/+243
| | | | | | | | | | | | | | | | | | | | | | | | | This readds a more or less completely new dvdnav implementation, though it's based on the code from before commit 41fbcee. Note that this is rather basic, and might be broken or not quite usable in many cases. Most importantly, navigation highlights are not correctly implemented. This would require changes in the FFmpeg dvdsub decoder (to apply a different internal CLUT), so supporting it is not really possible right now. And in fact, I don't think I ever want to support it, because it's a very small gain for a lot of work. Instead, mpv will display fake highlights, which are an approximate bounding box around the real highlights. Some things like mouse input or switching audio/subtitles stream using the dvdnav VM are not supported. Might be quite fragile on transitions: if dvdnav initiates a transition, and doesn't give us enough mpeg data to initialize video playback, the player will just quit. This is added only because some users seem to want it. I don't intend to make mpv a good DVD player, so the very basic minimum will have to do. How about you just convert your DVD to proper video files?
* input: fix bogus section disabling, add debugging outputwm42013-12-121-3/+11
| | | | | | | | The code to remove a section from the active section array wasn't correct (it should have tried to copy the elements in reverse), so just replace it with a macro that does the intended thing. Add some debug output to print the section stack.
* osd: add option for "unscaled" OSDwm42013-12-102-0/+3
|
* video: display last frame, drain frames on video reconfigwm42013-12-103-10/+87
| | | | | | | | | | | | | | | | | | | | | | Until now, the player didn't care to drain frames on video reconfig. Instead, the VO was reconfigured (i.e. resized) before the queued frames finished displaying. This can for example be observed by passing multiple images with different size as mf:// filename. Then the window would resize one frame before image with the new size is displayed. With --vo=vdpau, the effect is worse, because this VO queues more than 1 frame internally. Fix this by explicitly draining buffered frames before video reconfig. Raise the display time of the last frame. Otherwise, the last frame would be shown for a very short time only. This usually doesn't matter, but helps when playing image files. This is a byproduct of frame draining, because normally, video timing is based on the frames queued to the VO, and we can't do that with frames of different size or format. So we pretend that the frame before the change is the last frame in order to time it. This code is incorrect though: it tries to use the framerate, which often doesn't make sense. But it's good enough to test this code with mf://.
* video: move VO reinit from filter chain to playerwm42013-12-101-30/+56
| | | | | | | | | This gets rid of the vf_vo pseudo-filter. It ends the idea of MPlayer's architecture that the VO is just a (terminating) video filter. It didn't really work for us with respect to video timing (the "end" of the video chain isn't really made for video timing, and making it do so would be awkward), and now we're removing it entirely. We will be able to fix some things, such as properly draining video on reconfiguration.
* video: move handling of brightness and deinterlacing controlwm42013-12-102-6/+7
| | | | | Handling of brightness/gamma/saturation/etc. and deinterlacing is moved from vf_vo.c to dec_video.c.
* video: move video filter chain initialization from decoder to playerwm42013-12-103-21/+41
| | | | | | | | | | | | | This should help fixing some issues (like not draining video frames correctly on reinit), as well as decoupling the decoder, filter chain, and VO code. I also wanted to make the hardware video decoding fallback work properly if software-only video filters are inserted. This currently has the issue that the fallback is too violent, and throws away a bunch of demuxer packets needed to restart software decoding properly. But keeping "backup" packets turned out as too hacky, so I'm not doing this, at least not yet.
* options: allow hwaccel formats in -vf format/noformatwm42013-12-071-1/+1
| | | | | | | There are 3 users of the image format option type: demux_raw, vf_format, vf_noformat. Allow the hwaccel formats (like vdpau etc.) in general, so that the filters can use it. This won't work for demux_raw, so explicitly reject these formats there.
* video: create a separate context for video filter chainwm42013-12-074-23/+22
| | | | | | This adds vf_chain, which unlike vf_instance refers to the filter chain as a whole. This makes the filter API less awkward, and will allow handling format negotiation better.
* command: fix compilation with MinGWwm42013-12-071-1/+3
| | | | | This include header is needed for the fork/exec code, which is inactive on Windows anyway.
* player: load external subs for uncompressed rar archiveswm42013-12-061-3/+10
| | | | | | | | | | | | Uncompressed rar archives can be transparently opened, but the filename the player doesn't have the direct filename (but something starting with rar://... instead). This will lead to external subtitles not being loaded. This doesn't handle multi-volume rar files, but in that cases just use the --autosub-match=fuzzy option. Fixes #397 on github.
* video: remove --flipwm42013-12-052-3/+0
| | | | | | | | | | | | | | | | The --flip option flipped the image upside-down, by trying to use VO support, or if not available, by inserting a video filter. I'm not sure why it existed. Maybe it was important in ancient times when VfW based decoders output an image this way (but even then, flipping an image is a free operation by negating the stride). One nice thing about this is that it provided a possible path for implementing video orientation, which is a feature we should probably support eventually. The important part is that it would be for free for VOs that support it, and would work even with hardware decoding. But for now get rid of it. It's useless, trivial, stands in the way, and supporting video orientation would require solving other problems first.
* video: allow hardware decoding only for certain codecswm42013-12-051-1/+1
| | | | | | | | | | In particular, this disables mpeg4. There are some files out there that use GMC, a usually rarely used and ineffective feature, which is not supported by most hardware decoders. In these cases the hw decoder outputs garbage, while software decoding works perfectly fine. We can't really fallback to software decoding in these cases, because we don't know that something is wrong in the first place. I can't see any advantages of hw decoding of mpeg4, so it's better to disable it.
* options: remove legacy hacks for sub-option handlingwm42013-12-044-76/+13
|
* ad_lavc: expose an option to enable threadingwm42013-12-042-0/+2
|
* vd_lavc: factor out libavcodec thread setupwm42013-12-042-0/+20
|
* av_common: add timebase parameter to mp_set_av_packet()wm42013-12-042-20/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the timebase is set, it's used for converting the packet timestamps. Otherwise, the previous method of reinterpret-casting the mpv style double timestamps to libavcodec style int64_t timestamps is used. Also replace the kind of awkward mp_get_av_frame_pkt_ts() function by mp_pts_from_av(), which simply converts timestamps in a way the old function did. (Plus it takes a timebase parameter, similar to the addition to mp_set_av_packet().) Note that this should not change anything yet. The code in ad_lavc.c and vd_lavc.c passes NULL for the timebase parameters. We could set AVCodecContext.pkt_timebase and use that if we want to give libavcodec "proper" timestamps. This could be important for ad_lavc.c: some codecs (opus, probably mp3 and aac too) have weird requirements about doing decoding preroll on the container level, and thus require adjusting the audio start timestamps in some cases. libavcodec doesn't tell us how much was skipped, so we either get shifted timestamps (by the length of the skipped data), or we give it proper timestamps. (Note: libavcodec interprets or changes timestamps only if pkt_timebase is set, which by default it is not.) This would require selecting a timebase though, so I feel uncomfortable with the idea. At least this change paves the way, and will allow some testing.
* vf_vo: don't abuse option strings to set VOwm42013-12-041-4/+4
| | | | Whoever thought this was a good idea should be punched.
* vf_yadif: change options, reroute to vf_lavfiwm42013-12-041-3/+0
| | | | | | Also remove the ability to disable deinterlacing at runtime. You can still disable deinterlacing at runtime by using the ``D`` key and its automatical filter insertion/removal.
* options: add option to disable using right Alt key as Alt GrVivek Jain2013-12-024-0/+17
| | | | | | | | | mpv was hardcoded to always consider the right Alt key as Alt Gr, but there are parituclar combinations of platforms and keyboard layouts where it's more convenient to treat the right Alt as a keyboard modifier just like the left one. Fixes #388
* input: don't emit command when using multiple mouse buttons at oncewm42013-12-011-5/+21
| | | | | | | | | | | | | | | | | | | | | | This is for key bindings that use multiple mouse buttons at once. (Yes, this is weird, but MPlayer always had this feature, and apparently there are people using it!) Before this commit, clicking another mouse button while still holding the previous mouse button forced the command bound to the previous mouse button to be emitted. This is usually needed to make sure the input consumer (the player and the OSC) stays in sync with the actual mouse button state. If there's no command sent, the OSC in particular would think the button is still held down. However, sending the command is undesired behavior if you want to use these multiple-key binds. Solve this by emitting commands in this situation only if a key down command was sent earlier. Since mouse button key bindings are normally executed on key-up only, this happens with special commands like script_dispatch only (used by the OSD to track mouse buttons, but also used for other OSC bindings). See github issue #390.
* input: improve some commentswm42013-12-011-4/+4
| | | | | I have the feeling some of these were written before everything was changed all over again.
* command: add a revert_seek commandwm42013-12-013-1/+40
| | | | As discussed on IRC.
* options: add options that set defaults for af/vf/ao/vowm42013-12-014-4/+34
| | | | | | | | There are some use cases for this. For example, you can use it to set defaults of automatically inserted filters (like af_lavrresample). It's also useful if you have a non-trivial VO configuration, and want to use --vo to quickly change between the drivers without repeating the whole configuration in the --vo argument.
* Prevent creating zombieswm42013-11-301-3/+14
| | | | | | | | | | | | | | | | The "run" input command does fork+exec to spawn child processes. But it doesn't cleanup the child processes, so they are left as zombies until mpv terminates. Leaving zombie processes around is not very nice, so employ a simple trick to let pid 1 take care of this: we fork twice, and when the first fork exits, the second fork becomes orphaned and becomes pid 1's child. It becomes pid 1's responsibility to cleanup the process. The advantage is that we don't need extra logic to cleanup the spawned process, which could have an arbitrary lifetime. This is e.g. described here: http://yarchive.net/comp/zombie_process.html Also use _exit() instead of exit(). It's not really sane to run cleanup handlers (atexit() etc.) inside a forked process.
* Use O_CLOEXEC when creating FDswm42013-11-303-12/+18
| | | | | | | | | | | | | | This is needed so that new processes (created with fork+exec) don't inherit open files, which can be important for a number of reasons. Since O_CLOEXEC is relatively new (POSIX.1-2008, before that Linux specific), we #define it to 0 in io.h to prevent compilation errors on older/crappy systems. At least this is the plan. input.c creates a pipe. For that, add a mp_set_cloexec() function (which is based on Weston's code in vo_wayland.c, but more correct). We could use pipe2() instead, but that is Linux specific. Technically, we have a race condition, but it won't matter.
* command: add a cycle_values input commandwm42013-11-303-1/+84
|
* command: change the syntax and semantics of the "run" commandwm42013-11-302-6/+20
| | | | | | | See the changes in input.rst for explanations. Technically speaking, this also gets rid of some undefined behavior: passing NULL as a vararg (execl()) is always a bug.
* input: require space before '#' commentswm42013-11-301-8/+5
| | | | | | | | | | So e.g. show_text abc#def will now print "abc#def" instead of "#def". It's simpler, more consistent with how ";" and other things are handled, and also possibly avoids bothering the user with extra escaping.
* input: rearrange command parsingwm42013-11-301-44/+31
| | | | This simplifies some things as preparation for the next commits.
* build: add options for enabling and disabling any libquvi versionsNikoli2013-11-291-1/+1
| | | | Makes packaging a bit simpler.
* Take care of some libavutil deprecations, drop support for FFmpeg 1.0wm42013-11-292-4/+4
| | | | | | | | | | | | | | PIX_FMT_* -> AV_PIX_FMT_* (except some pixdesc constants) enum PixelFormat -> enum AVPixelFormat Losen some version checks in certain newer pixel formats. av_pix_fmt_descriptors -> av_pix_fmt_desc_get This removes support for FFmpeg 1.0.x, which is even older than Libav 9.x. Support for it probably was already broken, and its libswresample was rejected by our build system anyway because it's broken. Mostly untested; it does compile with Libav 9.9.
* player: always reset some variables on seekwm42013-11-291-4/+4
| | | | | | These were confined to the video path, but resetting them even if no video is available shouldn't really matter. Always resetting them makes the logic easier to follow, I think.
* video: restore printing warning on decreasing filter PTSwm42013-11-291-2/+2
| | | | | | | | Recently, the check was moved, so it was printed only for source video PTS (since that's easier, and filters should normally behave sane). But it turns out it's trivial to print a warning in the filter case too by reusing the code that normally checks for PTS forward jumps without needing any additional code, so, fine, restore warning in this case.
* build: make pthreads mandatorywm42013-11-282-15/+3