summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cache: minor simplificationwm42014-04-091-11/+7
| | | | | | | | The only difference is that the MP_DBG message is not printed anymore if the current user read position is outside of the current cache range. (In order to handle seek_limit==0 gracefully in the normal case of linear reading, change the comparison from ">=" to ">".)
* cache: adjust stream position if necessarywm42014-04-091-1/+6
| | | | | | | | | Until now, this could never happen, because new data was simply always appended to the end of the cache. But for making stream cache resizing easier, doing it this way seems advantageous. It also makes it harder to make the internal state inconsistent. (Before this change it could happen that cache and stream position went out of sync if the read position was adjusted "inappropriately".)
* cache: no short reads in read_bufferwm42014-04-091-16/+21
| | | | | | | Until now, cache_read() (which calls read_buffer()) could return short reads. This was a simplification allowed by the stream interface. But for cache resizing, it will be more practical to make read_buffer() do a full read.
* cache: move ringbuffer read into a separate functionwm42014-04-091-17/+32
| | | | No functional changes yet.
* cache: fix typo in commentwm42014-04-091-1/+1
|
* cache: always update cached controls after running a stream controlwm42014-04-091-0/+1
| | | | | | | Seems like a good idea. One possible bad effect would be slowing down uncached controls, but they're already slow. The good thing is that many controls make intrusive changes to the stream (at least controls which do write accesses), so the cached parameters should be updated.
* osc: fix playlist displayChrisK22014-04-091-2/+2
|
* manpage: --ad-spdif-dtshd=yes works nowwm42014-04-081-1/+2
| | | | | It was fixed a while ago. There are still some issues, as pointed out in the manpage addition.
* vd_lavc: by default, do not show corrupt frameswm42014-04-082-2/+2
| | | | This flips the default value. Use --vd-lavc-show-all=yes to revert.
* demux: add "BIKb" FourCCVika Apelsinova2014-04-081-0/+1
| | | | | | More support for the worst codec ever. Signed-off-by: wm4 <wm4@nowhere>
* client API: avoid redundant property change events if possiblewm42014-04-083-10/+63
| | | | | This is done simply by comparing the previous and current values. Do this only if the requested format is not MPV_FORMAT_NONE.
* command: property set commands should send property change notificationswm42014-04-081-1/+21
| | | | | | | | | Some of these property implementations already send notifications on their own, but most don't. This takes care of them. Of course this still doesn't handle all propertry changes - this is impossible without special-casing each property that can change on its own.
* lua: add API for observing property changeswm42014-04-083-4/+60
| | | | | A low level API was added already earlier, but that was merely a binding for the raw C API. Add a "proper" one, and document it.
* vo_vdpau: add an additional check for timestamp robustnesswm42014-04-081-0/+16
| | | | | | | | | | This might be a good idea in order to prevent queuing a frame too far in the future (causing apparent freezing of the video display), or dropping an infinite number of frames (also apparent as freezing). I think at this point this is most of what we can do if the vdpau time source is unreliable (like with Mesa). There are still inherent race conditions which can't be fixed.
* vo_vdpau: document what WRAP_ADD doeswm42014-04-081-0/+2
| | | | This wasn't necessarily clear.
* vo_vdpau: simplify previous vsync timestamp calculationwm42014-04-081-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | The strange thing about this code was the shift parameter of the prev_vs2 function. The parameter is used to handle timestamps before the last vsync, since the % operator handles negative values incorrectly. Most callers set shift to 0, and _usually_ pass a timestamp after the last vsync. One caller sets it to 16, and can pass a timestamp before the last timestamp. The mystery is why prev_vs2 doesn't just compensate for the % operator semantics in the most simple way: if the result of the operator is negative, add the divisor to it. Instead, it adds a huge value to it (how huge is influenced by shift). If shift is 0, the result of the function will not be aligned to vsyncs. I have no idea why it was written in this way. Were there concerns about certain numeric overflows that could happen in the calculations? But I can't think of any (the difference between ts and vc->recent_vsync_time is usually not that huge). Or is there something more clever about it, which is important for the timing code? I can't think of anything either. So scrap it and simplify it.
* vo_vdpau: simplify time management and make it more robustwm42014-04-071-68/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vo_vdpau used a somewhat complicated and fragile mechanism to convert the vdpau time to internal mpv time. This was fragile as in it couldn't deal well with Mesa's (apparently) random timestamps, which can change the base offset in multiple situations. It can happen when moving the mpv window to a different screen, and somehow it also happens when pausing the player. It seems this mechanism to synchronize the vdpau time is not actually needed. There are only 2 places where sync_vdptime() is used (i.e. returning the current vdpau time interpolated by system time). The first call is for determining the PTS used to queue a frame. This also uses convert_to_vdptime(). It's easily replaced by querying the time directly, and adding the wait time to it (rel_pts_ns in the patch). The second call is pretty odd: it updates the vdpau time a second time in the same function. From what I can see, this can matter only if update_presentation_queue_status() is very slow. I'm not sure what to make out of this, because the call merely queries the presentation queue. Just assume it isn't slow, and that we don't have to update the time. Another potential issue with this is that we call VdpPresentationQueueGetTime() every frame now, instead of every 5 seconds and interpolating the other calls via system time. More over, this is per video frame (which can be portantially dropped, and not per actually displayed frame. Assume this doesn't matter. This simplifies the code, and should make it more robust on Mesa. But note that what Mesa does is obviously insane - this is one situation where you really need a stable time source. There are still plenty of race condition windows where things can go wrong, although this commit should drastically reduce the possibility of this. In my tests, everything worked well. But I have no access to a Mesa system with vdpau, so it needs testing by others. See github issues #520, #694, #695.
* lua: add basic mpv_observe_property supportwm42014-04-061-0/+58
| | | | Undocumented and only the most basic functionality for now.
* client API: add a way to notify clients of property changeswm42014-04-065-3/+306
| | | | | | | | | | | | | | | | | | | | | | | | This turned out ridiculously complex. I think it will have to be simplified some day. Main reason for the complexity are: - filtering properties by forcing clients to observe individual properties explicitly (to avoid spamming clients with changes they don't want) - optional retrieval of property value with the notification (the basic idea was that this is more user friendly) - allowing to the client to specify a format in which the value should be retrieved (because if a property changes its type, the client API couldn't convert it properly, and compatibility would break) I don't know yet which of these are important, and everything could change. In particular, the interface and semantics should be adjusted to reduce the implementation complexity. While I consider the API complete, there could (and probably will) be bugs left. Also while the implementation is complete, it's inefficient. The complexity of the property matching is O(a*b*c) with a clients, b observed properties, and c properties changing at once. I threw away an earlier implementation using bitmasks, because it was too unwieldy.
* client API: use a manual ringbufferwm42014-04-061-31/+31
| | | | | | | Remove the use of mp_ring and use a simple array and a bunch of variables instead. This is way less awkwad. The change in reserve_reply fixes incorrect tracking of free events.
* gl_lcms: properly expand the cache filename being writtenStefano Pigozzi2014-04-051-1/+3
| | | | | This is needed to preserve the same path used when opening the cache file, and correctly expands ~ when icc-cache is added to the mpv config file.
* build: bump libbluray minimum versionStefano Pigozzi2014-04-051-1/+1
| | | | | The code uses BD_OVERLAY_HIDE which seems to be available from 0.3.0. Update the pkg-config query.
* build: add -Wempty-body to compiler flagswm42014-04-042-4/+4
| | | | Warns against "if(0);" but not "if(0){}" - perfect for our purposes.
* demux: move metadata-based replaygain decoding out of af_volumeAlessandro Ghedini2014-04-042-80/+87
|
* af_volume: use replaygain side dataAlessandro Ghedini2014-04-041-7/+19
|
* af: add replaygain_data field to af_stream and af_instanceAlessandro Ghedini2014-04-045-0/+7
| | | | Closes #664
* demux: add replaygain_data field to demuxer_tAlessandro Ghedini2014-04-042-1/+47
|
* build: check if replaygain side data is availableAlessandro Ghedini2014-04-042-0/+18
| | | | | | Signed-off-by: wm4 <wm4@nowhere> old-configure change by wm4.
* vo_vdpau: more debugging outputwm42014-04-031-4/+20
| | | | Might help to debug certain problems with Mesa.
* remove redundant/outdated line from encodeing.rst:"what works"Kevin Mitchell2014-04-031-1/+0
|
* lua: give more control over timerswm42014-04-022-14/+47
| | | | | | | | | | | Now they can be paused and resumed. Since pausing and disabling the timer is essentially the same underlying operation, we also just provide one method for it. mp.cancel_timer probably still works, but I'm considering this deprecated, and it's removed from the manpage. (We didn't have a release with this function yet, so no formal deprecation.)
* lua: add mp.unregister_event() functionwm42014-04-012-0/+31
| | | | Someone requested this... I think.
* DOCS/encoding: make "What does not work yet" a proper RST sectionwm42014-04-011-0/+1
|
* gl_lcms: fix build when lcms2 is not availableStefano Pigozzi2014-03-311-0/+5
| | | | Was broken in b0ee9334e.
* vo_corevideo: remove unused variableStefano Pigozzi2014-03-311-1/+0
|
* vo_opengl, cocoa: allow to autoselect a color profileStefano Pigozzi2014-03-318-2/+226
| | | | | | | | | | | | | This commit adds support for automatic selection of color profiles based on the display where mpv is initialized, and automatically changes the color profile when display is changed or the profile itself is changed from System Preferences. @UliZappe was responsible with the testing and implementation of a lot of this commit, including the original implementation of `cocoa_get_icc_profile_path` (See #594). Fixes #594
* ass_mp: don't use --subcp for --ass-styleswm42014-03-311-1/+1
| | | | | | | | | | | | | The --ass-styles option is implemented by calling ass_read_styles(). This function can take a codepage (so libass will use iconv to convert it). This was implemented before our --subcp option was changed, and this code was not updated. Now libass fails opening iconv, because --subcp is not always (and not by default) a valid iconv codepage. Just always pass NULL, which means the file passed to --ass-styles must be in UTF-8. The --ass-styles option is a fringe option anyway (and will destroy your subtitles), so having codepage support for it isn't important at all.
* encode_lavc: copy metadata to output fileAlessandro Ghedini2014-03-304-1/+24
| | | | | | | | Closes #684 Signed-off-by: wm4 <wm4@nowhere> Includes some minor cosmetic changes additional to the original PR.
* command: allow changing filters before video chain initializationwm42014-03-303-6/+22
| | | | | | | Apparently this is more intuitive. Somewhat tricky, because of the odd state after loading a file but before initializing the VO.
* command: change what the metadata property returnswm42014-03-302-11/+29
| | | | | | | Change the type of the property from a string list (alternating key/value entries) to a map. Using the client API, this will return MPV_FORMAT_NODE_MAP, while Lua mp.get_property_native returns a dictionary-like table.
* command: minor simplificationwm42014-03-301-6/+3
|
* command: fix access to "metadata/list" propertywm42014-03-301-0/+14
| | | | | | | | | The function tag_property() in command.c passed a key action with empty path to m_property_read_list. This is normally not valid, because key actions are supposed to access sub-paths. But it's kind of inconvenient to check for this case in tag_property(). So make it valid by providing a m_property_unkey() function, which turns a key access to "" into a top-level action.
* command: add helper function to split property pathswm42014-03-303-5/+28
| | | | | | We've just checked whether a sub-path started with "name/", but that changes behavior whether the property name has a trailing '/' or not. Using a helper function to split of path components avoids this problem.
* m_property: don't parse empty string as 0wm42014-03-301-1/+2
| | | | Nice strtol() usage error.
* osc: make OSC more responsive when pausedChrisK22014-03-301-0/+1
| | | | | Quick hack to impove situtation until the next major overhaul comes
* vf_eq: don't malloc priv structwm42014-03-301-1/+0
| | | | | There wasn't any reason for this. In fact, it's a memory leak. The proper priv struct is already allocated vf.c and the option parser.
* player: add missing "-" to options in workaround notice on A/V desynchronizationSebastian Morr2014-03-301-1/+1
| | | | | | While it technically works, using GNU-style options seems cleaner nowadays. Signed-off-by: wm4 <wm4@nowhere>
* ao_wasapi: make code shorterwm42014-03-301-65/+36
| | | | | | | | | Also fix a format string mistake in a log call using it. I wonder if this code shouldn't use FormatMessage, but it looks kind of involved [1], so: no, thanks. [1] http://support.microsoft.com/kb/256348/en-us
* stream_bluray: move lookup of AACS error codes into a functionwm42014-03-301-30/+16
| | | | Mostly a cosmetic change. Makes the code a little bit shorter.
* stream_bluray: check AACS and BD+ protectionsxylosper2014-03-301-5/+80
| | | | | | | There are two kind of encryption for Blu-ray disc, AACS and BD+, and both of them can be checked through BLURAY_DISC_INFO object. This commit makes the bluray and bdnav streams refuse playback if AACS/BD+ is detected and decryption is failed.
* audio: remove sample rate limit checkswm42014-03-301-7/+1
| | | | | | | | | | | This played the file at a wrong sample rate if the rate was out of certain bounds. A comment says this was for the sake of libaf/af_resample.c. This resampler has been long removed. Our current resampler (libav/swresample) checks supported sample rates on reconfiguration, and will error out if a sample rate is not supported. And I think that is the correct behavior.
* player: dvdnav: fix start time when entering and leaving menuwm42014-03-301-0/+4
| | | | | Unfortunately, quite a hack, because we have check the nav state outside of discnav.c.
* Merge remote-tracking branch 'mpv/pr/676'wm42014-03-3012-182/+566
|\
| * player: rename dvdnav to discnavxylosper2014-03-3011-29/+30
| | | | | | | | | | Now, navigation works both of DVD and non-BD-J Blu-ray. Therefore, rename all 'dvdnav' strings which are not DVD specific to 'discnav'
| * stream_bluray: cosmetic refactoringxylosper2014-03-301-74/+33
| | | | | | | | | | Remove unused variables. Declare variables when they are needed. Adjust brackets for mpv's convention. Clean up too many empty lines.
| * stream_bluray: select initial angle only if peeking title succeededxylosper2014-03-301-39/+52
| | | | | | | | | | | | The angles should be set and queried only if a valid title is selected. Also, in navigation mode, there are some limitations which make it impossible to query current title/angle.
| * stream_bluray: use more proper error code for stream controlxylosper2014-03-301-7/+7
| | | | | | | | | | | | Use STREAM_OK instead of hardcoded value 1. Handle failure of setting title as an unsupported behaviour rather than an error.
| * stream_bluray: implement navigation interface for Blu-ray streamxylosper2014-03-294-71/+482
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces new stream protocols: bdnav(and others). bdnav stream shares lots of codes with original bluray stream, so it's not separated in different source file. Major difference from bluray is that bdnav does not support longest title because there is no way to query that information. bdnav://menu and bdnav://first correspond to top menu title and first play title respectively, though they often point same title. Also, binary position based seeking has been removed, because it didn't have no point.
* | manpage: remove misleading description for --ontopStefano Pigozzi2014-03-291-2/+1
| | | | | | | | | | Pretty much all the VOs and backends support this, so there is no point in listing only X11 and corevideo support.
* | Fix compilation on OSX and win32wm42014-03-292-2/+1
| | | | | | | | Probably.
* | video/out: remove legacy colorspace stuffwm42014-03-2913-144/+115
| | | | | | | | | | | | | | | | | | Reduce most dependencies on struct mp_csp_details, which was a bad first attempt at dealing with colorspace stuff. Instead, consistently use mp_image_params. Code which retrieves colorspace matrices from csputils.c still uses this type, though.
* | mp_image: add missing field to mp_image_params_equals()wm42014-03-281-0/+1
|/ | | | | | This is pretty obscure, so it didn't matter much. It still breaks switching output levels at runtime, because the video output is not reinitialized with the new params.
* af_volume: fix replaygainwm42014-03-271-2/+3
| | | | | | | | This was accidentally broken in commit b72ba3f7. I somehow made the wild assumption that replaygain adjusted the volume relative to 0% instead of 100%. The detach suboption was similarly broken.
* stream_bluray: remove BD_EVENT_IDLEwm42014-03-261-3/+0
| | | | | | | | This was actually supposed to be removed with pull reuqest #671, but I accidentally re-added it with a rebasing mistake. This probably also coincidentally fixes compilation with older libbluray (issue #672).
* stream_bluray: use bd_get_playlist_info()xylosper2014-03-261-4/+10
| | | | | | | | Use bd_get_playlist_info() instead of bd_get_title_info(). The previous implementation couldn't query current playlist and this made it impossible to call bd_get_playlist_info() which is more desirable than bd_get_title_info() because, for Blu-rays, playlist is the unit of playback not title. This commit fixes that.
* stream_bluray: cache current playback informationsxylosper2014-03-261