Commit Graph

37638 Commits

Author SHA1 Message Date
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
xylosper 9946b8d4dd stream_bluray: use more proper error code for stream control
Use STREAM_OK instead of hardcoded value 1.
Handle failure of setting title as an unsupported behaviour rather
than an error.
2014-03-30 10:01:43 +09:00
Stefano Pigozzi bdc936af05 manpage: remove misleading description for --ontop
Pretty much all the VOs and backends support this, so there is no point in
listing only X11 and corevideo support.
2014-03-29 21:22:02 +01:00
xylosper 8cee8279ad stream_bluray: implement navigation interface for Blu-ray stream
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.
2014-03-29 23:31:46 +09:00
wm4 d27613b690 Fix compilation on OSX and win32
Probably.
2014-03-29 03:40:49 +01:00
wm4 bd0618f01f video/out: remove legacy colorspace stuff
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.
2014-03-29 00:25:08 +01:00
wm4 fdeda359f7 mp_image: add missing field to mp_image_params_equals()
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.
2014-03-28 23:13:41 +01:00
wm4 cd2d4ebf3b af_volume: fix replaygain
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.
2014-03-27 21:15:15 +01:00
wm4 e8d952c807 stream_bluray: remove BD_EVENT_IDLE
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).
2014-03-26 23:34:52 +01:00
xylosper facba0b317 stream_bluray: use bd_get_playlist_info()
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.
2014-03-26 21:00:48 +01:00
xylosper 6c947c64a1 stream_bluray: cache current playback informations
The cost of calling bd_get_title_info() is quite expensive and
requires lots of CPU usage. Using BD_EVENT_PLAYLIST and
BD_EVENT_TITLE, it's possible to cache BLURAY_TITLE_INFO object for
current title and BD_EVENT_ANGLE handler caches current angle. In
my test case, with this commit, CPU usage can be saved about 15-20%.
2014-03-26 21:00:48 +01:00
xylosper 4086a09695 stream_bluray: implement event handler for libbluray
This commit brings libbluray's event queue into stream_bluray.

Signed-off-by: wm4 <wm4@nowhere>
2014-03-26 21:00:47 +01:00
wm4 b292ca8702 mf: fix operation with --cache
demux_mf.c explicitly checks for the stream type to check whether images
are opened via pattern (mf://..., i.e. stream_mf.c) or directly. Of
course the stream type is not set to STREAMTYPE_MF if the stream is
wrapped through the cache, so it tried to open the pattern directly as
file, which failed.

Fix this by disabling caching for mf://. The cache doesn't make sense
here anyway, because each file is opened and closed every frame (perhaps
to avoid memory bloat).
2014-03-26 20:42:09 +01:00
wm4 5afef03a70 player: fix unchecked access for chapter metadata
It's possible that MPContext has a chapter list, but the demuxer
doesn't. In this case, accesing the chapter-metadata property would
lead to invalid accesses.

(This fixes the out of bound access, but in theory, the returned data
can still be incorrect, since MPContext chapters don't need to map
directly to demuxer chapters.)
2014-03-26 17:07:53 +01:00
wm4 3ad2a67d3f stream_cdda: print cd text header only if there are any cd text fields 2014-03-26 17:00:29 +01:00
wm4 6fa2c52589 stream_cdda: remove unused stuff
This cd_info_t struct was practically unused. The only thing it did was
storing the track name of the form "Track %d" in a very roundabout way.
Remove it. (It made more sense when there was still CDDB support.)
2014-03-26 16:55:27 +01:00
wm4 32d818f02b stream_cdda: fix track time accuracy
Don't use an integer division to get the time, since that would round on
second boundaries. Also round up the time by sector size. Seeking rounds
down due to alignment constraints, but if we round up the time, we can
make it land on the exact destination sector.

This fixes that the track change code printed the previous track when
seeking by chapter.
2014-03-26 16:51:17 +01:00
wm4 b342b1a30e dvdnav: fix minor memory leak
This was usually handled at the end of the switch statement, so if
something returns from the function before that, the event has to be
freed explicitly.
2014-03-25 15:44:47 +01:00
xylosper b5fe3e9a82 dvdnav: check and update video resolution whenever rendering
Previous implementation updated video resolution when highlight
event was given. However, this may not work if highlight event
is given before video size is queried.
This commit adds checking routine into rendering function, too.
2014-03-25 15:37:14 +01:00
xylosper 448b535d48 dvdnav: make MP_NAV_EVENT_RESET_ALL handled properly
dvdnav.c did not handle event in regular sequence. Usually this
does not make any trouble except around MP_NAV_EVENT_RESET_ALL.
Those events should be handled in regular sequence. If they're
mixed, it can make wrong result.
For instance, MP_NAV_EVENT_HIGHLIGHT right after
MP_NAV_EVENT_RESET_ALL should not be ignored but it might be
because MP_NAV_EVENT_RESET_ALL makes the demuxer reloaded and osd
hidden.
2014-03-25 15:37:14 +01:00
xylosper cb7cf1cfb1 dvdnav: prevent reallocation of fake highlight buffer
Since subsizes were never updated, the bitmap buffer was always
reallocated whenever mp_nav_get_highlight() called.
2014-03-25 22:25:29 +09:00
wm4 d2e4938c78 player: use MP_NOPTS_VALUE as rel_time_to_abs() error value
And consistently use MP_NOPTS_VALUE as error value for the users of this
function. This is better than using -1, especially because negative
values can be valid timestamps.
2014-03-25 02:32:24 +01:00
wm4 6c2cd08aff player: handle chapter range like --start/--end
Instead of comparing the current chapter every time, set the playback
end timestamp to the chapter end. Likewise, don't execute an extra seek
for the start chapter.

Maybe we could also use the timeline facility to restrict playback to
the given chapter range, but this would be strange when using
--chapter=N to start playback at a given chapter. Then you couldn't seek
back, which is possibly not what the user wants.
2014-03-25 02:27:22 +01:00
wm4 c19c777061 player: let chapter_start_time() return MP_NOPTS_VALUE for unknown times 2014-03-25 02:18:12 +01:00
wm4 5cae4a807c player: remove weird separation between no chapters and 0 chapters
For some reason, it mattered whether mpctx->chapters was NULL or not,
even if mpctx->num_chapters was 0. Remove this separation; it serves no
purpose.
2014-03-25 02:10:24 +01:00
wm4 92d7dc9e88 player: remove demuxer chapoter API wrappers
Instead, always use the mpctx->chapters array. Before this commit, this
array was used only for ordered chapters and such, but now it's always
populated if there are chapters.
2014-03-25 02:05:48 +01:00
wm4 2c693a4732 stream: remove old chapter handling code
Stream-level chapters (like DVD etc.) did potentially not have
timestamps for each chapter, so STREAM_CTRL_SEEK_TO_CHAPTER and
STREAM_CTRL_GET_CURRENT_CHAPTER were needed to navigate chapters. We've
switched everything to use timestamps and that seems to work, so we can
simplify the code and remove this old mechanism.
2014-03-25 01:38:18 +01:00
wm4 7bd3f26481 stream_cdda: report track times
Report the time for each chapter (tracks are treated as chapters). This
allows us to get rid of the "old" chapter mechanism, and also behaves
better with the frontend.

This makes assumptions about the audio formats, but that format is
hardcoded anyway in the rawaudio demuxer defaults (and always was).
2014-03-25 01:24:27 +01:00
wm4 7f39b4655e vo_opengl: runtime icc profile switching
The changes in vo_opengl.c are merely for adding the icc options to the
set of options than can be changed with the vo_cmdline command.
2014-03-24 23:33:10 +01:00
xylosper 99044308b5 stream_bluray: fix for significant memory leak
It's obvious but, since STREAM_CTRL_GET_TIME_LENGTH is called
frequently, the amount of leaked memory here is quite big.
2014-03-24 21:50:04 +09:00
wm4 f4fe22266d travis-ci: update Libav release
Libav 10 was released, so we can enable testing the stable Libav version
again.

FFmpeg 2.2 was also released, but since we still support 2.1.4, we stick
with the older version. This is better for testing.
2014-03-24 00:12:48 +01:00
wm4 bb1b0a9f42 player: remove confusing argc/argv adjustment
It's better if argc/argv always mean the same thing.
2014-03-23 21:46:29 +01:00
wm4 ba62e01cd3 x11_common: fix some problems with window dragging
There were some bad interactions with the OSC.

For one, dragging the OSC bar, and then moving the mouse outside of the
OSC (while mouse button still held) would suddenly initiate window
dragging. This was because win_drag_button1_down was not reset when
sending a normal mouse event, which means the window dragging code can
become active even after we've basically decided that the preceding
click didn't initiate window dragging.

Second, dragging the window and clicking on the OSC bar after that did
nothing. This was because no mouse button up event was sent to the core,
even though a mouse down event was sent. So make sure the key state is
erased with MP_INPUT_RELEASE_ALL.
2014-03-22 02:12:20 +01:00
wm4 f705bbb2d5 manpage: osc: document some recent additions 2014-03-20 22:49:31 +01:00
wm4 edf0dda2e4 manpage: clarify what to pass to --hwdec-codecs option 2014-03-20 22:49:09 +01:00
wm4 9be93d6b60 vdpau: remove pointer indirection for a field
There's no reason to. This is basically a cosmetic change.
2014-03-19 19:57:08 +01:00
wm4 917650fefa vdpau: fix decoder init return value 2014-03-19 19:35:25 +01:00
wm4 19f101db68 x11: implement window dragging by grabbing
We don't check whether the WM supports _NET_WM_MOVERESIZE_MOVE, but
if it doesn't, nothing bad happens. There might be a race condition
when pressing a button, and then moving the mouse and releasing the
button at the same time; then the WM might get the message to initiate
moving the window after the mouse button has been released, in which
case the result will probably be annoying. This could possibly be fixed
by sending _NET_WM_MOVERESIZE_CANCEL on button release, but on the
other hand, we probably won't receive a button release event in this
situation, so ignore this problem.

The dragging is initiated only when moving the mouse pointer after a
click in order to reduce annoying behavior when the user is e.g.
doubleclicking.

Closes #608.
2014-03-18 20:43:45 +01:00