summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* demux: add free_demuxer_and_stream() functionwm42015-02-205-18/+18
| | | | | Although their lifetimes are conceptually different, it happens often that a demuxer is destroyed together with its stream.
* player: move timeline scanning (ordered chapters etc.) to a threadwm42015-02-201-7/+15
| | | | | | | | | | | | Do timeline building (scanning & opening reference files for ordered chapters, and more) in a thread. As a result, this process can actually be stopped without having to kill the player. This is pretty simple: just reuse the demuxer opening thread. We have to give up on the idea that open_demux_reentrant() is reusable, though. (Althoughthe timeline readers still need some fixes before they react to the quit request.)
* player: cosmetics: async/non-blocking -> reentrantwm42015-02-203-13/+13
| | | | | | These functions do blocking work on a separate thread, but wait until they return. So they are not async or non-blocking. But they do react to user-input and client API accesses, which makes them reentrant.
* stream_file: open pipes non-blockingwm42015-02-201-4/+33
| | | | | Now the player can actually be quit if a pipe was opened, but nobody is writing to it.
* x11egl: minor cleanupwm42015-02-201-4/+6
| | | | Not like it matters, and is probably still not entirely correct.
* vo_opengl: minor robustness improvement in function loaderwm42015-02-201-2/+5
| | | | | | Check the scanf() return value, and don't continue if it doesn't find both numbers (can happen with GLES 1.0). Also, some implementations can return NULL from glGetString() if something is "broken".
* vo_opengl: add ginseng upscalerNiklas Haas2015-02-202-1/+12
| | | | | | | | | This is a variation of ewa_lanczos that is sinc-windowed instead of jinc-windowed. Results are pretty similar, but the logic is simpler. This could potentially replace the ugly ewa_lanczos code. It's hard to tell, but from comparing stills I think this one has slightly less ringing than regular ewa_lanczos.
* vo_opengl: fix smoothmotion coefficient calculation, for real this timeNiklas Haas2015-02-201-24/+31
| | | | | | I've reworked pretty much all the logic to correspond to what the theory actually describes. With this commit, playback is wonderfully smooth on my machine.
* demux_lavf: apply hacks even if format is forcedwm42015-02-201-27/+28
| | | | | | | | | | | | | Some of the hacks were not applied if the file format was forced. Commit 37a0c914 moved them to a table, which is checked with normal probing only. Fixes #1612 (DVD forces mpeg, which in turn has to export native stream IDs specifically). Do some code restructuring on the way. For example, the probescore can simply be set to the correct initial value, instead of checking whether it was set at all.
* manpage: fix vf_scale arnd parameterwm42015-02-191-2/+2
| | | | | | | It probably was always a flag, so the documentation became invalid as soon as mpv stopped accepting 0/1 for flags. Fixes #1608.
* build: fix Python 3 unicode issue with waf 1.8.6wm42015-02-191-1/+7
| | | | | | | | | | | | | Starting with waf 1.8.6 (in Python 3), the hcode variable isn't a string, but a byte string. This commit adds the solution proposed in the upstream waf bug report: https://code.google.com/p/waf/issues/detail?id=1535 It seems a bit overly verbose, but on the other hand, this solution has the chance of being most correct/compatible. Fixes #1604.
* travis: update libass depwm42015-02-181-1/+1
| | | | Use a libass version that does not fail; switch to github releases.
* build: require recent libasswm42015-02-182-2/+2
| | | | | | | | | Nobody should use an older version. It's perfectly backwards and forward compatible, so distros have no excuse not to package a recent version. Older versions lack tons of bug fixes (some of them crashing bugs, and potentially security relevant). With love to Debian, which is still on 0.10.2.
* demux_lavf: blacklist bintext fileswm42015-02-181-0/+3
| | | | | | Whatever the hell that is. FFmpeg tries to open any files with .bin file extension with this demuxer (unless it finds a better demuxer), and then reads the whole damn file, along with spamming dumb crap.
* cache: silence "EOF reached" messagewm42015-02-181-1/+1
| | | | | | | | | | | | | This message will be printed relatively often once EOF is reached. In some cases this is rather annoying, for example when playing HLS. (With HLS, the stream is just a playlist file, while libavformat opens actual media files without mpv's knowledge, so the cache is completely useless and hits EOF instantly.) That it retries reading is apparently a good thing: at least local files can grow, and even after the player got the EOF, playback _could_ be resumed by basically polling and detecting that there is more data. So I'm not changing this behavior yet.
* player: enable cache and demuxer thread for subtitles toowm42015-02-1810-3/+26
| | | | | | | | | Includes some logic for not starting the demuxer thread for fully read subtitles. (Well, the cache will still waste _lots_ of resources, and the cache always has to be created, because we don't know whether it'll be needed _before_ opening the file.) See #1597.
* demux_lavf: reorganize hackswm42015-02-181-67/+70
| | | | | | | | | | | An attempt to make format-specifics more declarative. (In my opinion, all of this should be either provided by libavformat, or should not be needed.) I'm still leaving many checks with matches_avinputformat_name(), because they're so specific. Also useful for the following commit.
* player: allow unsetting --term/osd-playing-msgwm42015-02-181-2/+2
| | | | | | Treat an empty string as unset. The fact that the option values can be NULL is merely weirdness due to how the option parser works (it unfortunately doesn't initialize string fields to non-NULL).
* demux_lavf: set interrupt_callbackwm42015-02-181-0/+11
| | | | | | Helps with terminating the stream if e.g. HLS streams are stuck. (For other demuxers, the stream's interrupt callback already takes care of this.)
* input: minor cleanupwm42015-02-182-12/+11
| | | | | | | Add MP_KEY_MOUSE_ENTER to the ignored input if the user has disabled mouse input. Remove one instance of code duplication, and add a MP_KEY_IS_MOUSE_MOVE macro to summarize events that are caused by moving the mouse.
* find_subfiles: Add 'vtt' to subtitle extensionsJaime Marquínez Ferrándiz2015-02-181-1/+1
|
* input: add MOUSE_ENTER keybinding.torque2015-02-187-3/+21
| | | | Signed-off-by: wm4 <wm4@nowhere>
* demux, matroska: remove demuxer type fieldwm42015-02-174-39/+29
| | | | | | | | | | | | | The Matroska timeline code was the only thing which still used the demuxer.type field. This field explicitly identifies a demuxer implementation. The purpose of the Matroska timeline code was to reject files that are not Matroska. But it already forces the Matroska format, meaning loading will explicitly only use the Matroska demuxer. If the demuxer can't open the file, no other demuxer will be tried, and thus checking the field is redundant. The change in demux_mkv_timeline.c removes the if condition, and unindents the if body.
* demux: remove file_contents fieldwm42015-02-174-11/+25
| | | | | | | Only demux_cue and demux_edl used it. It's a weird field and doesn't help with anything anymore - by now, it only saves a priv context in the mentioned demuxers. Reducing the number of confusing things the demuxer struct has is more important than minimizing the code.
* demux_edl: make independent from MPContextwm42015-02-174-48/+36
|
* demux_edl: move implementationwm42015-02-174-306/+280
| | | | Same deal as with demux_cue, and a separate commit for the same reasons.
* demux_cue: make independent from MPContextwm42015-02-174-40/+36
| | | | Also see previous commit(s).
* demux_cue: move implementationwm42015-02-174-421/+388
| | | | | | | | Move the implementation, of which most was in tl_cue.c, to demux_cue.c. Currently, this is illogical, because tl_cue.c still accesses MPContext. This is going to change, and then it will be better if everything is in demux_cue.c. This is only a separate commit to distinguish code movement and actual work; the next commit will do the actual work.
* demux: copy priv pointer toowm42015-02-171-0/+1
| | | | | Weird, but helps with the case a demuxer gets handed its own instance from outside.
* matroska: move timeline code to demux/wm42015-02-173-2/+2
| | | | | Separate from previous commit, because git is bad at tracking file renames when the file contents are also changed.
* matroska: make timeline code independent of MPContextwm42015-02-175-115/+122
|
* player: use a separate context for timeline loader stuffwm42015-02-177-22/+130
| | | | | | | | | | | | | | | | | | | | | | | | Instead of accessing MPContext in player/timeline/*, create a separate context struct, which the timeline loaders fill out. It turns out that there's not much in the way too big MPContext that these need to access. One major PITA is managing (and closing) the set of open demuxers. The problem is that we need a list of all demuxers to make sure no unneeded streams are enabled. This adds a callback to the demuxer_desc struct, with the intention of leaving to to the demuxer to call the right loader, instead of explicitly checking the demuxer type and dispatching manually in common code. I also considered making the timeline part of the demuxer state, but decided against: it's too much of a mess wrt. memory management and threading, and also doesn't make it clear who owns the child demuxers. With the struct timeline decoupled from the demuxer state, it's at least somewhat clear that the child demuxers are independent from the "main" demuxer. The actual changes to player/timeline/* are separated in the following commits, because they're quite verbose. Some artifacts will be removed later as soon as there's only 1 timeline loading mechanism.
* demux: chapters without metadata are allowedwm42015-02-171-2/+3
| | | | Makes some of the following commits slightly simpler. Also fix a typo.
* player: use a macro to remove an element from an arraywm42015-02-171-6/+1
| | | | Should be equivalent.
* player: actually close files when using sub_removewm42015-02-171-13/+38
| | | | | | | | | Also effects some other cases. The real reason for this is for keeping track of which demuxers can be closed (see following commit). Since I don't want to use reference counting for this, some sort of simplistic mark-and-sweep is done to determine whether a demuxer is still needed.
* DOCS/client-api-changes: mark 0.8.0 releasewm42015-02-171-2/+3
| | | | | (There was a missing version bump for the msg-level change; just move it under 1.14.)
* demux_lavf: hack against hls showing "100%" positionwm42015-02-171-0/+6
| | | | | | | | | | | | | The HLs protocol consists of a "playlist" main file, which mpv downloads and passes to the HLS demuxer. The HLS demuxer actually requests segment files containing media data on its own. The packets read from the demuxer have a source file position set, but it's not from the main file. This leads to a strange effect: as a last fallback, the player will calculate the approximate playback position from the file position/size ratio, and since the main file is tiny, this will always show 100%. Fix this by resetting the packet file position. This doesn't affect the case when HLS actually reports a duration.
* command: add rescan_external_fileswm42015-02-166-4/+46
| | | | | | | | | Requested. Hopefully will be useful for things that download and add external subtitles on demand. Or something. Closes #1586.
* command: nicer OSD message when setting audio-devicewm42015-02-161-0/+14
| | | | Requested.
* etc/input.conf: remove a leftoverwm42015-02-161-2/+0
| | | | This is already mapped by default.
* vo_opengl: glsl: remove trailing \wm42015-02-161-2/+2
| | | | | This should be no problem... but it _might_ help with #1536, so it's worth a try.
* vf_vapoursynth: replace a hack with a newer VS API functionwm42015-02-163-3/+3
| | | | | The new function does exactly what we need. Replaces the old hack, which created the vscore by running an empty script.
* m_config: log options set by the client API toowm42015-02-161-0/+7
|
* sub: mess with styling defaults, change --ass-use-margins behaviorwm42015-02-1610-27/+70
| | | | | | | | | | | | | | | | | | | Now --ass-use-margins doesn't apply to normal subtitles anymore. This is probably the inverse from the mpv behavior users expected so far, and thus a breaking change, so rename the option, that the user at least has a chance to lookup the option and decide whether the new behavior is wanted or not. The basic idea here is: - plain text subtitles should have a certain useful defalt behavior, like actually using margins - ASS subtitles should never be broken by default - ASS subtitles should look and behave like plaintext subtitles if the --ass-style-override=force option is used This also subtly changes --sub-scale-with-window and adds the --ass- scale-with-window option. Since this one isn't so important, don't bother with compatibility.
* options: mark some more options as runtime-settablewm42015-02-161-4/+4
| | | | | Most of these are in the category of options which can be changed without issues, but which will not take effect immediately.
* osd: customizable subtitle and OSD positionwm42015-02-164-0/+22
| | | | | | You can set in which "corner" the OSD and subtitles are shown. I'd prefer it a bit more general (so you could set the alignment using a factor), but the libass API does not provide this.
* osd: make it possible to have different subtitle vs. OSD defaultswm42015-02-163-27/+44
| | | | | | | | Until now, they used exactly the same defaults for the styling options. The defaults were shared, so it was impossible to have different defaults. Change this. This requires duplicating the full default struct, even for settings that are the same. The list of options is still shared, though.
* mpv.desktop: Add zh-TW and zh-CN translationsSkyrainfit2015-02-161-1/+6
|
* osxbundle: config file special case isn't needed anymorewm42015-02-152-6/+0
| | | | | | The previous commit effectively fixes the mess caused by 'config' vs. 'mpv.conf', and the hack introduced by commit e01a6dac and extended by commit db167cd4 isn't needed anymore.
* player: undeprecate 'config' fileswm42015-02-153-29/+16
| | | | | | | Actually, it's pretty simple to look for multiple filenames at once, since mp_find_all_config_files() is already a bit "special" anyway. See #1569. Reverts most of commit db167cd4 (keeps osx-bundle.conf).
* vd_lavc: uninit the hwdec backend after closing the decoderwm42015-02-141-6/+3
| | | | | | | | | | | | | | | | | A recent behavior change in libavcodec's h264 decoder keeps at least 1 surface even after avcodec_flush_buffers() has been called. We used to flush the decoder in order to make sure all surfaces are free'd, so that the hw decoder can be safely uninitialized. This doesn't work anymore. Fix it by closing the AVCodecContext before the hw decoder is uninitialized. This is actually simpler and more robust. It seems to be well-supported too. Fixes invalid read accesses with vaapi-copy and dxva2-copy. These destroyed the hwdec API fully on uninit, and could not deal with surfaces surviving the decoder. Probably fixes #1587.
* x11: fix uninitialized variable readswm42015-02-141-1/+1
| | | | This line of code ended up in the wrong block in commit cd6dfcbe.
* ao: fix null dereferenceStefano Pigozzi2015-02-141-0/+2
|
* player: fix audio-device-list updateswm42015-02-143-0/+8
| | | | | | | The way the AO wakes up the playloop has nothing to do with events; instead we must query the events on the AO once the playloop was woken up. Querying the events in every playloop iteration is thus the correct way to do this.
* client API: clarify filename string encodingwm42015-02-141-0/+24
| | | | | | | Admittedly, the behavior on Windows is not quite straightforward. The behavior on the other platforms is equivalent to fopen(). Fixes #1585.
* demux: fix dropped subtitle packets with the new stream switchingwm42015-02-142-3/+4
| | | | | | | | | | | | | | If the previous subtitle packet is too far back, and the refresh seek won't pick it up, and the packet never comes again. As a consequence, the refresh mode was never stopped on the subtitle stream, which caused all packets to be discarded. Fix by assuming the file position is monotonically increasing; then it will resume even if a packet _after_ the intended resume point is returned. This introduces a new requirement on how the demuxer behaves. (I'm not sure if mp4 actually satisfies this requirement in all cases.) Fixes a regression introduced by commit f9f2e1cc.
* cocoa: remove unused functionStefano Pigozzi2015-02-141-7/+0
|
* ao_coreaudio: add support for hotplug notificationsStefano Pigozzi2015-02-146-27/+111
| | | | | | | | | | This commit adds notifications for hot plugging of devices. It also extends the old behaviour of the `audio-out-detected-device` property which is now backed by the hotplugging code. This allows clients to be notified when the actual audio output device changes. Maybe hotplugging should be supported for ao_coreaudio_exclusive too, but it's device selection code is a bit fragile.
* x11: add XK_Cancel to the list of special keysMartin Herkt2015-02-143-0/+3
| | | | | Some IR receivers emit this key by default for remote control buttons. Make it mappable.
* Fix build on OSX broken by previous commitwm42015-02-131-1/+1
| | | | Hopefully.
* vf_vapoursynth: add display refresh rate propertyJulian2015-02-134-0/+7
| | | | | This value is not necessarily trustworthy (it might change) and can be 0.
* x11: return a framerate even if no window is mappedwm42015-02-131-8/+11
| | | | | Falls back to the first display in the list returned by xrandr. Not entirely correct, but makes some people happy (see #1575).
* player: deprecate 'config' files (use mpv.conf), warn against clasheswm42015-02-132-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently there's at least one distro which ships a /etc/mpv/mpv.conf file (mpv doesn't install such a file). This breaks config files named 'config' located in the user's mpv config directory, because mpv first loads files named 'config' and then 'mpv.conf'. There is no mechanism for putting files with different names into the same config path order. (Even worse, that mpv.conf file only set an option to the default value. Why do distros always do very stupid things?) Print a warning on collisions. Although using 'config' was well-supported, supporting both names is starting to become messy, so deprecate 'config' and print a warning if one is found. At least we will be able to remove the whole mess once 'config' files are ignored... This also affects the osx-bundle, which intentionally used these not-so- optimal semantics. Solve it in a different way. (Unfortunately with an ifdef - it's not required, but having to explain everyone why mpv tries to load a osx-bundle.mpv file on Linux and Windows would consume energy.) Closes #1569.
* command: mark get_property as deprecatedwm42015-02-132-3/+6
| | | | | Using it just makes no sense. But we're really being nice about this and don't remove it immediately.
* x11: make all XF86 special keys mappablewm42015-02-132-1/+13
| | | | | | | | Makes all keys documented in XF86keysym.h mappable. This requires the user to deal with numeric keycodes; no names are queried or exported. This is an easy way to avoid adding all the hundreds of XF86 keys to our X11 lookup table and mpv's keycode/name list.
* ipc: put playback core to sleep while dequeuing commandswm42015-02-131-1/+7
| | | | | | | Happens to fix #1581 due to an unfortunate interaction with the way the VO does not react to commands for a while