Commit Graph

40682 Commits

Author SHA1 Message Date
wm4 4b447c71fe README: movie -> media
Requested in #935.
2015-02-08 15:19:49 +01:00
wm4 0ab1509f14 vo: minor simplification
Whatever.
2015-02-07 21:14:43 +01:00
wm4 75edecb526 vo_vdpau: minor simplification
No change in behavior.
2015-02-07 21:14:12 +01:00
wm4 62b0f64c24 Revert "vo_opengl: disable alpha by default"
This reverts commit a33b46194c.

It turns out FFmpeg really considers this a bug, and fixed it by making
the decoder output the correct pixel format.

Fixes #1565. Reverts the fix #1528, though it should work fine with
a recent git master FFmpeg.
2015-02-06 23:23:27 +01:00
wm4 be5994a781 video: work around libswscale for PNG pixel formats
The intention is that we can test vo_opengl with high bit depth PNGs
better. This throws libswscale completely out of the loop, which before
was needed in order to convert from big endian to little endian.

Also apply a minimal cleanup to fmt-conversion.c (unrelated).
2015-02-06 23:22:16 +01:00
wm4 5de29b860b stream: get rid of remaining uses of the end_pos field
Most things stopped using this field for better support of growing
files. Go through the trouble to repalce the remaining uses, so it can
be removed.

Also move the "streaming" field; saves 4 bytes (wow!).
2015-02-06 21:43:52 +01:00
wm4 347cf97231 stream: minor cleanups
Fix return types and return values to make them more consistent. Some
reformatting and making code more concise.

In stream_reconnect(), avoid the additional mp_cancel_test() call by
moving the "connection lost" message below the mp_cancel_wait() call,
which effectively leads to the same behavior when the stream was already
canceled. (The goal is not to show the message in this case.)

Merge stream_seek_long() into stream_seek(). It was the only caller.

Always clear the eof flag on seeks.

Reduce access to stream internals in cache.c and stream_lavf.c.
2015-02-06 21:43:52 +01:00
wm4 45e214d7ae stream: slightly improve reconnect behavior
Wait for a longer time between reconnects. Introdeuce and use
mp_cancel_wait(), so that quitting is still immediate.
2015-02-06 19:19:15 +01:00
wm4 e14d09c8a6 stream_lavf: fix build with Libav
The API function used is FFmpeg-only.

Sigh...
2015-02-06 18:02:37 +01:00
wm4 f3ae845fd2 options: add --network-timeout
Not quite sure if this actually works as intended.

Fixes #1566.
2015-02-06 17:01:35 +01:00
wm4 ffe894ec0a options: change --msg-level option
Make it accept "," as separator, instead of only ":". Do this by using
the key-value-list parser. Before this, the option was stored as a
string, with the option parser verifying that the option value as
correct. Now it's stored pre-parsed, although the log levels still
require separate verification and parsing-on-use to some degree (which
is why the msg-level option type doesn't go away).

Because the internal type changes, the client API "native" type also
changes. This could be prevented with some more effort, but I don't
think it's worth it - if MPV_FORMAT_STRING is used, it still works the
same, just with a different separator on read accesses.
2015-02-06 16:48:52 +01:00
wm4 1a38741dce options: allow ":" as separator in key-value lists
Before this, unquoted occurrences of ":" lead to parsing errors. There's
no reason to reject it, especially since the traditional MPlayer syntax
uses ":" as separator. (Which is also the reason why ":" was rejected
before: the parser shares this code for handling splitting/quoting, and
we merely checked explicitly whether the option was split on ",".)
2015-02-06 15:42:12 +01:00
Ben Boeckel c9558e560e tl_matroska: only check the chapter count when adding chapters
Fixes #1445 without failing in the case where file outside.mkv with N
chapters references inside.mkv with N+1 chapters. Since we don't care
about the number of chapters in inner files (yet; nested chapters would
change this, but also make chapters dynamic anyways), don't check there.
2015-02-06 11:55:16 +01:00
Ben Boeckel aa9347883f tl_matroska: squeeze down the number of parameters
Much cleaner. The difference between timeline_info and
inner_timeline_info is that timeline_info is stuff the top-level cares
about and inner_timeline_info is just for the current chapter.
2015-02-06 11:55:15 +01:00
Niklas Haas 4fed18e81e
vo_opengl: add support for linear scaling without CMS
This introduces a new option linear-scaling, which is now implied by
srgb, icc-profile and sigmoid-upscaling.

Notably, this means (sigmoidized) linear upscaling is now enabled by
default in opengl-hq mode. The impact should be negligible, and there
has been no observation of negative side effects of sigmoidized scaling,
so it feels safe to do so.
2015-02-06 03:37:21 +01:00
Niklas Haas 4872443fc0
vo_opengl: get rid of unused field approx_gamma
This was left over from 61f5a80.
2015-02-06 02:55:49 +01:00
wm4 cfd3d5b520 player: do not autoload audio with audio files, enable autoloading
Autoload external audio files only if there's at least a video track
(which is not coverart pseudo-video).

Enable external audio file autoloading by default. Now that we actively
avoid doing stupid things like loading an external audio file for an
audio-only file, this should be fine.

Additionally, don't autoload subtitles if a subtitle is played.
Although you currently can't play subtitles without audio or video,
it's disturbing and stupid that the player might load subtitle files
with different extension and then fail.
2015-02-05 22:14:17 +01:00
wm4 3b5d7d1a1c manpage: move out the MPlayer comparison page
Giving this such a prominent place is not really appropriate anymore.
Most people seeing this would probably expect a release changelog, not
something about MPlayer.

Since the page still could be useful for former MPlayer users (in
particular to avoid confusion with renamed options etc.), still keep
it in the DOCS directory.
2015-02-05 22:12:11 +01:00
wm4 f438da85c7 demux_mkv: remove the realmedia field
Granted, this doesn't help much with anything, other than the hate-
driven desire to remove or at least reduce anything that has to do with
RealMedia.
2015-02-05 21:55:11 +01:00
wm4 7f4b0fa867 demux_mkv: reindent, cosmetics
Reindent the whole handle_realaudio() function, and make the surrouding
if block return early instead.

Also contains some cosmetics to the sipr swapping, which hopefully does
not change the semantics, but is untested (the kind of cosmetic changes
everyone loves so much). May the person responsible for sipr rot in
hell. (It was probably done to obfuscate the codec?)
2015-02-05 21:54:32 +01:00
wm4 5e10b74b78 demux_mkv: simplify realaudio handling
Staring at the code, it doesn't look like the extra code for "normal"
audio is needed. Most of it looks like artifacts from the previous code
structure (much of it was added in the initial commit). I couldn't find
a sample that uses this code path to fully confirm this, though.
2015-02-05 21:54:19 +01:00
wm4 e68f4be17a demux_mkv: remove realvideo-specific aspect ratio handling
I suppose it could lead to subtle changes in behavior in presence of
realvideo files that change aspect radio. With the only sample I had
available, the behavior actually improved (azumi.mkv from the MPlayer
samples FTP; when starting playback in the middle it used the wrong
aspect ratio).
2015-02-05 21:54:08 +01:00
wm4 e2f4554fd9 demux_mkv: use libavcodec parser for realvideo
Appears to work, so we can drop some code. For some really odd reason,
the descrambling done on the timestamp requires millisecond units (due
to the "algorithm", not the libavcodec API).
2015-02-05 21:53:49 +01:00
wm4 5e9ba816cf demux_mkv: retrieve timestamps from libavcodec parser
Fixes vp9 missing timestamps. This requires a brand new libavcodec (the
patch for this was just applied to FFmpeg git master).

The timestamp mangling is applied to VP9 only. It'd probably work with
other codecs, but it's not needed. It could break in various ways, so
it has to be explicitly checked for every enabled codec.
2015-02-05 21:52:21 +01:00
wm4 1f2a370a03 demux_mkv: refactor packet parsing
Makes it somewhat more uniform, and breaks up the awfully deep nesting.

This implicitly changes multiple small details, rather than only moving
code around. In particular, this computes the packet fields first and
parses them afterwards, which is needed for the next commit.
2015-02-05 21:52:07 +01:00
Stefano Pigozzi f8d7756a14 build: add option to generate a clang compilation database
The compilation database is a JSON file[1] storing all compilation flags. That
is useful for tools using libclang for code completion and error reporting
(for example: YouCompleteMe for vim).

[1]: http://clang.llvm.org/docs/JSONCompilationDatabase.html
2015-02-05 21:06:34 +01:00
wm4 c5f1391ebb vo_vdpau: remove unneeded code
This is already done in the common vo.c code.
2015-02-04 23:38:00 +01:00
wm4 23fd114299 vo_opengl: redraw when pausing while showing an interpolated frame
If smoothmotion is enabled, and the screen shows an interpolated frame
the moment you pause, redraw a non-interpolated frame.
2015-02-04 23:37:38 +01:00
wm4 9248f75853 options: allow things like --geometry=x50
Although the use is somewhat questionable, it seems strange that e.g.
--geometry=50% works (and sets the width only), but setting the height
only in a similar manner does not work.
2015-02-04 23:15:14 +01:00
wm4 868d0f1e83 matroska: warn against mismatching segments
Matroska ordered chapters require all segment files to have the same
layout. If a referenced file has more tracks than the main file or
misses some tracks, the file is invalid.

Also see issue #1553.
2015-02-04 23:04:21 +01:00
wm4 59dc351772 player: move timeline specific handling to timeline loaders
In particular, gets rid of the Matroska specifics from the common code.
2015-02-04 23:04:21 +01:00
wm4 f8dc5db315 manpage: document hook API
This shouldn't exist and for the most part is meant to be used by the
ytdl Lua script, but let's document it anyway. Since the Lua API handles
all the details, it's considered much more "stable" than the raw API,
which is why the raw API wasn't documented.
2015-02-04 23:04:21 +01:00
wm4 e163284b68 command: add on_unload hook
Fixes #1552.
2015-02-04 23:04:01 +01:00
wm4 5bce4664be stream_cdda: fix bugs in chapter time retrieval
Looks like a bunch of off-by-one errors.

The track number was mistakenly offset by 1 - this shifted all chapters
by one, and make the first chapter start on the second track (so the
"chapter" property returned -1 in the first track since it was before
the first chapter).

Also, the calculation of the sector destination was messed up. This
comes from commit 32d818f0, where I apparently attempted to calculate
the position to one byte before the section, but unfortunately math
doesn't work this way and it was nonsense. Just drop this idea; while it
may help with seeking (probably...), it also returns slightly different
times. The user shall use hr-seeks if accurate seeking is required.

Hopefully fixes #1560.
2015-02-04 15:17:49 +01:00
wm4 b715fb6df1 demux_raw: output smaller audio packets
Currently, audio packets are always filtered as a whole. Since demux_raw
output a 1 second long packet, this could lead to large delays when
applying softvol volume. It could be fixed by splitting the frames the
decoder outputs before filtering them (like the old filter code used
to), but since this didn't cause any other problems yet, I'm going with
the simpler fix.

Fixes #1558.
2015-02-04 10:42:23 +01:00
Kevin Mitchell a501e2a6d1 osdep/subprocess-posix: remove __GLIBC__ guard
It's the wrong thing to check. For example it doesn't work on cygwin.
Just live with the warning.
2015-02-03 14:34:52 -08:00
wm4 acc5e8f574 player: make --force-window create the window immediately on start
Before this change, window creation was delayed until the video was
initialized. This guaranteed that the first window size was that of the
video, so the WM would place it correctly.

Some time ago, it was requested on the IRC channel that --force-window
should not do this. Sometimes, it can take a while until video is
initialized, e.g. when youtube-dl is used (which incurs lots of network
delay). In this case, it's awkward that it takes so long until a window
(any window) is shown.

On the other hand, this can cause incorrect window placement with some
WMs. We simply hope that this won't happen with modern WMs. (Although it
does with the WM I use, crappy old IceWM.)
2015-02-03 23:19:38 +01:00
wm4 c3c714b059 player: remove --fixed-vo
In ancient times, this was needed because it was not default, and many
VOs had problems with it. But it was always default in mpv, and all VOs
are required to deal with it. Also, running --fixed-vo=no is not useful
and just creates weird corner cases. Get rid of it.
2015-02-03 23:11:08 +01:00
wm4 de81cb07f4 options: allow more options to be changed at runtime
This allows setting these options directly (without going through
properties, or with going through the "options/" property). The
documented restrictions apply to all of these: changes do not get
immediately applied, unlike with corresponding properties.

This is in reaction to #1548.
2015-02-03 23:11:08 +01:00
Stefano Pigozzi eacf22e42a cocoa: improve refresh rate fallback code
Apparently CoreGraphics reports the actual refresh rate. DisplayLink can also
query the nominal refresh rate of the display so we use that as fallback
instead of the fugly 60fps hardcode added in aeb1fca0d.

Props to people on https://github.com/glfw/glfw/issues/137
2015-02-03 22:59:54 +01:00
Stefano Pigozzi aeb1fca0d4 cocoa: automatically fetch display-fps from the monitor
Comment explains why I have been so doubtful at adding this. The Apple docs
say CGDisplayModeGetRefreshRate is supposed to work only for CRTs, but it
doesn't, and actually works for LCD TVs connected over HDMI and external
displays (at least that's what I'm told, I don't have the hardware to test).
Maybe Apple docs are incorrect.

Since AFAIK Apple doesn't want to give us a better API – maybe in the fear we
might be able to actually write some useful software instead of "apps" –
I decided not to care as well and commit this.
2015-02-03 22:07:37 +01:00
wm4 a33b46194c vo_opengl: disable alpha by default
This reverts the default behavior introduced in commit 93feffad. Way too
often libavcodec will return RGB data that has an alpha channel as per
pixel format, but actually contains garbage.

On the other hand, this will actually render garbage color values in
e.g. PNG files (for pixels with alpha==0, the color value should be
essentially ignored, which is what the old alpha blend mode did).

This "fixes" #1528, which is probably a decoder bug (or far less likely,
a broken file).
2015-02-03 21:00:21 +01:00
wm4 e6664e94a1 demux_disc: fix CDDA seekability
The only reason why cdda:// goes through this wrapper-demuxer is so that
we add chapters to it. Most things related to seeking apply only to
DVD/BD, and in fact broke CDDA sekkability.

Fixes #1555.
2015-02-03 19:32:30 +01:00
wm4 fd78d77586 vo_opengl: avoid unnecessary shader reinit on fullscreen toggle
Makes it unnecessarily slow. It's still needed if the sigmoid crap is
actually used.
2015-02-03 17:39:30 +01:00
wm4 98828886d4 vo_opengl: change initialization of gamma option
Make the lazy gamma initialization less weird, and make the default
value of the "gamma" sub-option 1.0. This means --vo=opengl:help will
list the actual default value.

Also change the lower bound to 0.1 - avoids a division by zero (I don't
know how shaders handle NaN, but it's probably not a good idea to give
them this value).
2015-02-03 17:19:34 +01:00
wm4 f296dcb248 csputils, vo_opengl: remove per-component gamma
There was some code accounting for different gamma values for R/G/B.
It's inherited from an old, undocumented MPlayer feature, which was at
some point disabled for convenience by myself (meaning you couldn't
actually set separate gamma because it was removed from the property
interface - mp_csp_copy_equalizer_values() just set them to the same
value). Get rid of these meaningless leftovers.
2015-02-03 16:52:44 +01:00
wm4 0f560bbf8a csputils: remove some unused functions, make some private
mp_gen_gamma_map() and mp_gen_yuv2rgb_map() were used by vo_opengl_old
only. The other functions removed from csputils.h are used by csputils.c
only.
2015-02-03 16:38:38 +01:00
xylosper 95fd83a269 command: new commands audio_add/audio_remove/audio_reload
These commands are counterparts of sub_add/sub_remove/sub_reload which
work for external audio file.

Signed-off-by: wm4 <wm4@nowhere>
(minor simplification)
2015-02-03 13:53:39 +01:00
wm4 2c22fcd350 options: fix parsing for options/af and options/vf
Basically, the declared option name and the name passed to the
parse_obj_settings_list() must be the same.

Fixes the issue addressed in #1550, but differently.
2015-02-03 13:40:55 +01:00
Niklas Haas 9d62482cdc
vo_opengl: change upper bound of :gamma to 2.0
This allows a spread of 1.0 in either direction, which is already close
to absurd. Anything higher than that is pretty pointless.
2015-02-03 12:29:19 +01:00