Commit Graph

37875 Commits

Author SHA1 Message Date
ChrisK2 4f689258cb osc: fix playlist display 2014-04-09 18:10:51 +02:00
wm4 83874e9429 manpage: --ad-spdif-dtshd=yes works now
It was fixed a while ago. There are still some issues, as pointed
out in the manpage addition.
2014-04-08 23:19:04 +02:00
wm4 98f5d4c30c vd_lavc: by default, do not show corrupt frames
This flips the default value. Use --vd-lavc-show-all=yes to revert.
2014-04-08 23:05:15 +02:00
Vika Apelsinova 77a2d79edb demux: add "BIKb" FourCC
More support for the worst codec ever.

Signed-off-by: wm4 <wm4@nowhere>
2014-04-08 22:59:53 +02:00
wm4 89d400dc21 client API: avoid redundant property change events if possible
This is done simply by comparing the previous and current values. Do
this only if the requested format is not MPV_FORMAT_NONE.
2014-04-08 22:06:39 +02:00
wm4 d6022f33d6 command: property set commands should send property change notifications
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.
2014-04-08 21:24:14 +02:00
wm4 a94020e25b lua: add API for observing property changes
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.
2014-04-08 21:10:00 +02:00
wm4 708f32b746 vo_vdpau: add an additional check for timestamp robustness
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.
2014-04-08 20:16:53 +02:00
wm4 a62276bf56 vo_vdpau: document what WRAP_ADD does
This wasn't necessarily clear.
2014-04-08 19:13:15 +02:00
wm4 a748b62709 vo_vdpau: simplify previous vsync timestamp calculation
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.
2014-04-08 19:02:57 +02:00
wm4 929793be7f vo_vdpau: simplify time management and make it more robust
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.
2014-04-07 18:37:12 +02:00
wm4 6f8c5d1f6d lua: add basic mpv_observe_property support
Undocumented and only the most basic functionality for now.
2014-04-06 03:22:49 +02:00
wm4 49d1b42f70 client API: add a way to notify clients of property changes
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.
2014-04-06 03:22:49 +02:00
wm4 14eb233da9 client API: use a manual ringbuffer
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.
2014-04-06 03:22:49 +02:00
Stefano Pigozzi aa77f5dd3c gl_lcms: properly expand the cache filename being written
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.
2014-04-05 18:13:00 +02:00
Stefano Pigozzi e2bd5139ad build: bump libbluray minimum version
The code uses BD_OVERLAY_HIDE which seems to be available from 0.3.0. Update
the pkg-config query.
2014-04-05 18:12:33 +02:00
wm4 dad50c379c build: add -Wempty-body to compiler flags
Warns against "if(0);" but not "if(0){}" - perfect for our purposes.
2014-04-04 18:35:30 +02:00
Alessandro Ghedini 60e24fa842 demux: move metadata-based replaygain decoding out of af_volume 2014-04-04 18:35:30 +02:00
Alessandro Ghedini da984c3648 af_volume: use replaygain side data 2014-04-04 18:35:29 +02:00
Alessandro Ghedini e7977ec875 af: add replaygain_data field to af_stream and af_instance
Closes #664
2014-04-04 18:35:29 +02:00
Alessandro Ghedini 41ba6dad72 demux: add replaygain_data field to demuxer_t 2014-04-04 18:35:29 +02:00
Alessandro Ghedini cc3d4a2725 build: check if replaygain side data is available
Signed-off-by: wm4 <wm4@nowhere>

old-configure change by wm4.
2014-04-04 18:35:29 +02:00
wm4 d26db0662a vo_vdpau: more debugging output
Might help to debug certain problems with Mesa.
2014-04-03 19:41:09 +02:00
Kevin Mitchell 12e4a31594 remove redundant/outdated line from encodeing.rst:"what works" 2014-04-03 11:13:31 +02:00
wm4 e3e9661a33 lua: give more control over timers
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.)
2014-04-02 17:09:45 +02:00
wm4 3207366daa lua: add mp.unregister_event() function
Someone requested this... I think.
2014-04-01 00:37:50 +02:00
wm4 84ab860031 DOCS/encoding: make "What does not work yet" a proper RST section 2014-04-01 00:37:50 +02:00
Stefano Pigozzi c2c9cb2bbf gl_lcms: fix build when lcms2 is not available
Was broken in b0ee9334e.
2014-03-31 22:31:24 +02:00
Stefano Pigozzi 12e2290703 vo_corevideo: remove unused variable 2014-03-31 22:10:33 +02:00
Stefano Pigozzi b0ee9334e3 vo_opengl, cocoa: allow to autoselect a color profile
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
2014-03-31 22:07:33 +02:00
wm4 956b01ec4e ass_mp: don't use --subcp for --ass-styles
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.
2014-03-31 18:44:44 +02:00
Alessandro Ghedini 01e8a9c9e3 encode_lavc: copy metadata to output file
Closes #684

Signed-off-by: wm4 <wm4@nowhere>

Includes some minor cosmetic changes additional to the original PR.
2014-03-30 20:04:20 +02:00
wm4 239dc2851a command: allow changing filters before video chain initialization
Apparently this is more intuitive.

Somewhat tricky, because of the odd state after loading a file but
before initializing the VO.
2014-03-30 19:59:26 +02:00
wm4 392997fa10 command: change what the metadata property returns
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.
2014-03-30 19:21:33 +02:00
wm4 3fe6426ae0 command: minor simplification 2014-03-30 18:50:35 +02:00
wm4 01f3e46290 command: fix access to "metadata/list" property
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.
2014-03-30 13:50:23 +02:00
wm4 5cd20c7320 command: add helper function to split property paths
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.
2014-03-30 13:41:03 +02:00
wm4 7cc985f3d0 m_property: don't parse empty string as 0
Nice strtol() usage error.
2014-03-30 13:29:56 +02:00
ChrisK2 1a23ca2766 osc: make OSC more responsive when paused
Quick hack to impove situtation until the next major overhaul
comes
2014-03-30 12:24:12 +02:00
wm4 9db08cf53b vf_eq: don't malloc priv struct
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.
2014-03-30 10:19:02 +02:00
Sebastian Morr 9b5cbe4bf0 player: add missing "-" to options in workaround notice on A/V desynchronization
While it technically works, using GNU-style options seems cleaner nowadays.

Signed-off-by: wm4 <wm4@nowhere>
2014-03-30 09:17:24 +02:00
wm4 a1afc15786 ao_wasapi: make code shorter
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
2014-03-30 09:13:52 +02:00
wm4 1bc17a4fb8 stream_bluray: move lookup of AACS error codes into a function
Mostly a cosmetic change. Makes the code a little bit shorter.
2014-03-30 08:57:14 +02:00
xylosper c2bd34cfce stream_bluray: check AACS and BD+ protections
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.
2014-03-30 08:51:43 +02:00
wm4 ae448e198f audio: remove sample rate limit checks
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.
2014-03-30 07:34:43 +02:00
wm4 9be2f6b9f8 player: dvdnav: fix start time when entering and leaving menu
Unfortunately, quite a hack, because we have check the nav state
outside of discnav.c.
2014-03-30 07:31:02 +02:00
wm4 8487bb2c54 Merge remote-tracking branch 'mpv/pr/676' 2014-03-30 07:21:25 +02:00
xylosper fb47f2f940 player: rename dvdnav to discnav
Now, navigation works both of DVD and non-BD-J Blu-ray. Therefore,
rename all 'dvdnav' strings which are not DVD specific to 'discnav'
2014-03-30 11:42:49 +09:00
xylosper f2088c73e3 stream_bluray: cosmetic refactoring
Remove unused variables. Declare variables when they are needed.
Adjust brackets for mpv's convention. Clean up too many empty lines.
2014-03-30 11:16:32 +09:00
xylosper a78ac37aa9 stream_bluray: select initial angle only if peeking title succeeded
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.
2014-03-30 11:13:46 +09:00