Commit Graph

37548 Commits

Author SHA1 Message Date
wm4 bb0290145a sub: remove old MPlayer DVD sub decoder
The DVD sub decoder in Libav 9 was broken/incomplete, so we kept the
MPlayer decoder around. Now it's not needed anymore.
2014-03-16 13:19:28 +01:00
wm4 3ec7f528c4 vd_lavc: remove compatibility crap
All this code was needed for compatibility with very old libavcodec
versions only (such as Libav 9).

Includes some now-possible simplifications too.
2014-03-16 13:19:19 +01:00
wm4 75b185dfc5 travis-ci: update ffmpeg stable tarball 2014-03-16 02:57:41 +01:00
wm4 f50455507e build: drop support for Libav 9
I have no tolerance for this garbage anymore. There are tons of issues
with it (see e.g. previous commit), and there is no reason to use it
either. Use Libav git, or Libav 10 when it's released.

This also drops support for earlier FFmpeg release, which have exactly
the same issues as Libav 9. FFmpeg 2.1.4 is still supported, because
it's the latest release, and is reasonably recent. (Although this will
probably also be dropped as soon as FFmpeg 2.2 is released.)

Assumed version table (lots of nonsensical numbers):

        FFmpeg 2.1.4    FFmpeg (n2.2-rc2)   Libav (v10_beta2)

lavu    52.48.101       52.66.100           53.3.0
lavc    55.39.101       55.52.102           55.34.1
lavf    55.19.104       55.33.100           55.12.0
lsws    2.5.101         2.5.101             2.1.2
lavi    3.90.100        4.2.100             4.2.0
lswr    0.17.104        0.18.100            -
lavr    1.1.0           1.2.0               1.1.0

libpostproc and libavdevice are not interesting.

Following this commit, code needed just to support old Libav versions
will start to be removed.
2014-03-16 02:45:58 +01:00
wm4 ba160f5c84 vd_lavc: ridiculous workaround for Libav 9 compatibility
This "sometimes" crashed when seeking. The fault apparently lies in
libavcodec: the decoder returns an unreferenced frame! This is
completely insane, but somehow I'm apparently still expected to
work this around. As a reaction, I will drop Libav 9 support in the
next commit. (While this commit will go into release/0.3.)
2014-03-16 01:38:13 +01:00
wm4 86689f7bf2 demux_libass: change how external ASS subtitles are loaded
Instead of parsing the ASS file in demux_libass.c and trying to pass the
ASS_Track to the subtitle renderer, just read all file data in
demux_libass.c, and let the subtitle renderer pass the file contents to
ass_process_codec_private(). (This happens to parse full files too.)

Makes the code simpler, though it also relies harder on the (messy)
probe logic in demux_libass.c.
2014-03-15 22:17:51 +01:00
wm4 f6b4f60264 command: rename dvd- properties to disc-
Since these are not DVD-only, but can also be used with BDs.
2014-03-15 20:53:59 +01:00
wm4 e09a8ec4fa DOCS/coding-style: add another requirement for commit messages 2014-03-15 18:44:32 +01:00
wm4 5dde276018 options: fix off-by-1 error in option help output 2014-03-15 18:42:10 +01:00
wm4 8a75b19cd4 command: prefix DVD title properties with "dvd-"
They're strictly DVD-only, so it's better to mark them as such. This
also documentes the "title" (now renamed to "dvd-title") property.

This also avoids collision with the --title option. (Technically, there
was no problem. But it might be confusing for users, since we have a
policy of naming properties and options the same if they refer to the
same underlying functionality.)
2014-03-15 18:42:10 +01:00
xylosper 746666f096 command: add new property 'title'
This commit adds new property 'title' which indicates current
playing title of disc. This property is useful when using a stream
whose title can be changed during playback, e.g., dvdnav.
2014-03-15 18:42:10 +01:00
xylosper 9e4014d876 stream_dvdnav: implement STREAM_CTRL_GET_NUM_TITLES for dvdnav
This commit provides impelmentation of STREAM_CTRL_GET_NUM_TITLES
for dvdnav stream. Other streams for DVD or Blu-ray are already
provide STREAM_CTRL_GET_NUM_TITLES.
2014-03-15 18:42:07 +01:00
wm4 16596d025a ao: print (estimated) device buffer size on init in verbose mode 2014-03-14 22:37:46 +01:00
wm4 c473635f66 af_volume: don't print missing replaygain tags as error
There's no reason to. Audio files often lack them.
2014-03-14 22:37:46 +01:00
wm4 dc0f2308d1 af_volume: add detach option
Maybe this should be default. On the other hand, this filter does
something even if the volume is neutral: it clips samples against the
allowed range, should the decoder or a previous filter output garbage.
2014-03-14 22:37:46 +01:00
wm4 b72ba3f744 af_volume: separate softvol volume control from replaygain level
Currently, both replaygain adjustment and user volume control (if
softvol is enabled) share the same variable. Sharing the variable would
cause especially if --volume is used; then the replaygain volume would
always be overwritten.

Now both gain values are simple added right before doing filtering.
2014-03-14 22:37:46 +01:00
wm4 66bfb17979 manpage: af: minor syntax improvements 2014-03-14 22:37:45 +01:00
wm4 f8f69cdffe af_volume: remove double-negated suboption
You had to use "no-replaygain-noclip" to set this option. Rename it, so
that only one negation is needed.
2014-03-14 22:37:45 +01:00
Ryan Goulden 3160182a7b build: fix unicode handling of the version string
Don't pass unicode types to waf ENV.
As per https://code.google.com/p/waf/issues/detail?id=1420
This directly fixes the "CFVersion" key in the .app bundle plist.
2014-03-14 22:10:22 +01:00
James Ross-Gowan 5e698a7b39 player/main: Fix Cygwin build
Xlib.h (included from x11_common.h) defines a macro 'Status' as 'int'.
This messed up a bunch of definitions in windows.h and broke the build
in Cygwin. Including windows.h first seems to solve the problem.

This commit also removes the definition of an unused flag.
2014-03-13 14:36:20 +01:00
xylosper d391e2d204 command: fix wrong condition & remove redundant stream type checking 2014-03-13 14:36:20 +01:00
xylosper 2f72eecd89 command: set 'media-title' property for bluray disc with meta-data 2014-03-13 14:36:20 +01:00
Alessandro Ghedini d80dc885c6 af_volume: add support for replaygain pre-amp and clipping prevention 2014-03-13 14:36:20 +01:00
Alessandro Ghedini 3f0139e5db af_volume: add replaygain support
This adds the options replaygain-track and replaygain-album. If either is set,
the replaygain track or album gain will be automatically read from the track
metadata and the volume adjusted accordingly.

This only supports reading REPLAYGAIN_(TRACK|ALBUM)_GAIN tags. Other formats
like LAME's info header would probably require support from libav.
2014-03-13 14:36:20 +01:00
Alessandro Ghedini 04e14ec8f6 af: add metadata field to af_stream and af_instance
This allows to propagate metadata information to audio filters.

Closes #632
2014-03-13 14:36:20 +01:00
wm4 7918034e15 DOCS/coding-style: add an example and another rule 2014-03-13 00:42:50 +01:00
wm4 3bc78a84cd af_lavfi: beat it into working with Libav
The main incompatibility was that Libav didn't have av_opt_set_int_list.
But since that function is excessively ugly and idiotic (look how it
handles types), I'm not missing it much. Use an aformat filter instead
to handle the functionality that was indirectly provided by it. This is
similar to how vf_lavfi works.

The other incompatibility was channel handling. Libav consistently uses
channel layouts only, why ffmpeg still requires messing with channel
counts to some degree. Get rid of most channel count uses (and hope
channel layouts are "exact" enough). Only in one case FFmpeg fails with
a runtime check if we feed it AVFrames with channel count unset.

Another issue were AVFrame accessor functions. FFmpeg introduced these
for ABI compatibility with Libav. I refuse to use them, and it's not my
problem if FFmpeg doesn't manage to provide a stable ABI for fields
provided both by FFmpeg and Libav.
2014-03-13 00:29:17 +01:00
wm4 1a86322dca README: split list of dependencies
And make some additions.

I'm not really sure why we list dependencies that are not ours, but that
of external libraries. Still might be useful, though.
2014-03-12 17:02:57 +01:00
wm4 4ded6204a1 DOCS/tech-overview: DOCS/OUTDATED-tech/ was deleted 2014-03-12 16:38:25 +01:00
wm4 d1fef81e8c DOCS: add coding style
I've tried not to be too detailed (because it's not a reference, just
some guidelines), but it still got relatively long. Also contains
conventions for sending patches.
2014-03-12 16:38:20 +01:00
James Ross-Gowan 3bcb4b8a9e w32_common: prevent MOUSE_BTN0 sticking after drag
The window doesn't recieve a WM_LBUTTONUP message after it's dragged,
probably because it's swallowed by the modal loop. To stop the button
from sticking, release it manually when the drag is complete.
2014-03-12 14:51:25 +01:00
James Ross-Gowan 6402b9dc38 w32_common: capture mouse input
Mouse buttons can get stuck down if the button is pressed inside the
video window and released outside. Avoid this by capturing mouse input
when a button is pressed.
2014-03-12 14:51:07 +01:00
wm4 b05803c2e1 build: make check for BSD fstatfs() a bit more strict
Linux also has fstatfs(), and the test relied on certain system include
files being available on BSD, but not on Linux. It would break if Linux
added the missing includes for some reason.

Make it a bit stricter, and check for the struct statfs field the code
needs.
2014-03-12 00:49:16 +01:00
Philip Sequeira ac4b9a47ce stream_file: network file system detection for Linux
Addresses issue #558 on Linux systems.

Signed-off-by: wm4 <wm4@nowhere>
2014-03-12 00:46:18 +01:00
wm4 14c1816c71 build: automagically extract client library version
This reads MPV_CLIENT_API_VERSION from the source header, and turns it
into a 3 part version number.

E.g. if MPV_CLIENT_API_VERSION were 0x12abcdef, this would result in
"18.171.773615" (8 bits, 8 bits, 16 bits).

We'll see if this is actually useful, or if it's too clever.
2014-03-12 00:40:55 +01:00
wm4 40855d6c12 build: rename --enable-shared switch
Rename it to --enable-libmpv-shared. The option name didn't really
tell much. When we add the possibility to create a static library,
it would also be bad if that were named --enable-static (because it
would sound like it does what --static-build does).
2014-03-11 23:56:19 +01:00
Alessandro Ghedini 8737ca9582 build: fix version in mpv.pc 2014-03-11 23:30:50 +01:00
Diogo Franco (Kovensky) a0347e0651 ao_wasapi: Use the character set conversion functions from io.h
...rather than rolling out our own. The only possible advantage is that
the "custom" ones didn't use talloc.
2014-03-11 16:37:22 -03:00
Diogo Franco (Kovensky) c5012946ee ao_wasapi: Implement AOCONTROL_UPDATE_STREAM_TITLE 2014-03-11 16:37:22 -03:00
Diogo Franco (Kovensky) f8bdada77f ao_wasapi: Implement per-application mixing
The volume controls in mpv now affect the session's volume (the
application's volume in the mixer). Since we do not request a
non-persistent session, the volume and mute status persist across mpv
invocations and system reboots.

In exclusive mode, WASAPI doesn't have access to a mixer so the endpoint
(sound card)'s master volume is modified instead. Since by definition
mpv is the only thing outputting audio in exclusive mode, this causes no
conflict, and ao_wasapi restores the last user-set volume when it's
uninitialized.
2014-03-11 16:37:21 -03:00
Diogo Franco (Kovensky) f3e9b94622 ao_wasapi: Move non-critical code outside of the event thread
Due to the COM Single-Threaded Apartment model, the thread owning the
objects will still do all the actual method calls (in the form of
message dispatches), but at least this will be COM's problem rather than
having to set up several handles and adding extra code to the event
thread.

Since the event thread still needs to own the WASAPI handles to avoid
waiting on another thread to dispatch the messages, the init and uninit
code still has to run in the thread.

This also removes a broken drain implementation and removes unused
headers from each of the files split from the original ao_wasapi.c.
2014-03-11 16:37:02 -03:00
Diogo Franco (Kovensky) 58011810e5 ao_wasapi: Split into 2 files
ao_wasapi.c was almost entirely init code mixed with option code and
occasionally actual audio handling code. Split most things to
ao_wasapi_utils.c and keep the audio handling code in ao_wasapi.c.
2014-03-11 16:37:02 -03:00
Diogo Franco (Kovensky) f3514fb4bd ao_wasapi: Initial conversion to the new pull model
Gets rid of the internal ring buffer and get_buffer. Corrects an
implementation error in thread_reset.

There is still a possible race condition on reset, and a few refactors
left to do. If feasible, the thread that handles everything
WASAPI-related will be made to only handle feed events.
2014-03-11 16:37:01 -03:00
Alessandro Ghedini 499a67582a build: install client.h under mpv/ instead of libmpv/ 2014-03-11 19:15:42 +01:00
Alessandro Ghedini dfc57e6d32 libmpv: add pkg-config file 2014-03-11 19:15:42 +01:00
Diogo Franco e00dcfb0f5 options.rst: correct broken URL 2014-03-11 14:09:19 -02:00
wm4 d7dfd2cca3 Revert "player: simplify audio reset when seeking"
This reverts commit 75dd3ec210.

This broke seeking with ordered chapters in some situations. While
the reverted commit was perfectly fine for playback of normal files,
it overlooked that in the ordered chapters case switching segments
actually reinitialized the audio chain completely, including the
decoder. And decoders still read packets on initialization. We can
restore the original commit as soon as decoders stop doing this.
2014-03-10 23:47:31 +01:00
wm4 ccce58d6d6 video: initialize hw decoder in get_format
Apparently the "right" place to initialize the hardware decoder is in
the libavcodec get_format callback.

This doesn't change vda.c and vdpau_old.c, because I don't have OSX, and
vdpau_old.c is probably going to be removed soon (if Libav ever manages
to release Libav 10). So for now the init_decoder callback added with
this commit is optional.

This also means vdpau.c and vaapi.c don't have to manage and check the
image parameters anymore.

This change is probably needed for when libavcodec VDA supports gets a
new iteration of its API.
2014-03-10 22:56:26 +01:00
Niklas Haas fbddbce01d vo_opengl: Correct and clarify gl_check_features
This updates the logic for the new, somewhat unified behavior of SRGB
and 3DLUT since 34bf9be (not that it was particularly correct even that
change) and checks for the presence of corresponding extensions only in
the cases in which they're needed.
2014-03-10 22:56:26 +01:00
Niklas Haas 6a833797db vo_opengl: Simplify and clarify color correction code
This commit:

- Changes some of the #define and variable names for clarification and
  adds comments where appropriate.
- Unifies :srgb and :icc-profile, making them fit into the same step of
  the decoding process and removing the weird interactions between both
  of them.
- Makes :icc-profile take precedence over :srgb (to significantly reduce
  the number of confusing and useless special cases)
- Moves BT709 decompanding (approximate or actual) to the shader in all
  cases, making it happen before upscaling (instead of the old 0.45
  gamma function). This is the simpler and more proper way to do it.
- Enables the approx gamma function to work with :srgb as well due to
  this (since they now share the gamma expansion code).
- Renames :icc-approx-gamma to :approx-gamma since it is no longer tied
  to the ICC options or LittleCMS.
- Uses gamma 2.4 as input space for the actual 3DLUT, this is now a
  pretty arbitrary factor but I picked 2.4 mainly because a higher pure
  power value here seems to produce visually better results with wide
  gamut profiles, rather then the previous 1.95 or BT.709.
- Adds the input gamma space to the 3dlut cache header in case we change
  it more in the future, or even make it user customizable (though I
  don't see why the latter would really be necessary).
- Fixes the OSD's gamma when using :srgb, which was previously still
  using the old (0.45) approximation in all cases.
- Updates documentation on :srgb, it was still mentioning the old
  behavior from circa a year ago.

This commit should serve to both open up and make the CMS/shader code much
more accessible and less confusing/error-prone and simultaneously also
improve the performance of 3DLUTs with wide gamut color spaces.

I would liked to have made it more modular but almost all of these
changes are interdependent, save for the documentation updates.

Note: Right now, the "3DLUT takes precedence over SRGB" logic is just
coded into gl_lcms.c's compile_shaders function. Ideally, this should be
done earlier, when parsing the options (by overriding the actual
opts.srgb flag) and output a warning to the user.

Note: I'm not sure how well this works together with real-world
subtitles that may need to be color corrected as well. I'm not sure
whether :approx-gamma needs to apply to subtitles as well. I'll need to
test this on proper files later.

Note: As of now, linear light scaling is still intrinsically tied to
either :srgb or :icc-profile. It would be thinkable to have this as an
extra option, :linear-scaling or similar, that could be used with or
without the two color management options.
2014-03-10 22:56:25 +01:00