Commit Graph

37318 Commits

Author SHA1 Message Date
wm4 92133b1dcd command: expose track list as properties 2014-02-16 03:51:02 +01:00
wm4 801de5ac6d m_property: add a mechanism to organize a list of sub-properties
This automatically adds a "count" sub-property, and for each entry in
the range [0, count), a numbered sub-property to access the item.
2014-02-16 03:51:02 +01:00
wm4 486658e5c7 demux: expose stream_type_name() function 2014-02-16 03:51:02 +01:00
wm4 c236cb7679 command: export more video params as properties
This uses the previously added sub-property mechanism to export a bunch
of stuff. For example, "video-params/w" now contains the video width.
2014-02-16 03:51:02 +01:00
wm4 309ae76e0b m_property: add a sub-property mechanism
This adds a mechanism for easier export of sub-properties. The following
commits will make use of it to export fine grained information about
certain things. The sub-property mechanism reduces the amount of code
needed to export a data value to 1 line.
2014-02-16 03:51:02 +01:00
wm4 ccfbe43455 csputils: provide string descriptions of chroma locations 2014-02-16 03:51:02 +01:00
Diogo Franco (Kovensky) 317a02bdd4 Merge branch 'master' of git://github.com/mpv-player/mpv
* 'master' of git://github.com/mpv-player/mpv:
  win32: restore support for exe directory as config directory
  crosscompile-mingw: improve instructions for MXE
  sd_lavc: handle subtitles with no subtitle resolution set
  options: make --no-config block all auto-loaded configuration files
  lua: auto-load scripts from ~/.mpv/lua/
  lua: make register_event() not overwrite previous event handler
2014-02-15 19:44:58 -03:00
Diogo Franco (Kovensky) 4a66fce7d3 Parse::Matroska::Reader: get rid of `bigrat`
It seems that it was causing issues with certain perl setups (such as
the one on issue #549). It also turns out that it was not behaving correctly
(not all constants were being promoted to big nums as they should), so we
use explicit objects to derive the constants.

There were also precedence issues. I wonder if this even worked right to
begin with.

The 'double' path (8-byte floats) is untested, as I couldn't easily find
a file with such a field.

Closes #549.
2014-02-15 19:43:22 -03:00
elevengu 792c1750ec win32: restore support for exe directory as config directory
Same rationale as b2c2fe7a but updated to work with path-win.c

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

Merges/closes #543.
2014-02-14 21:55:04 +01:00
wm4 cf6d6666e2 crosscompile-mingw: improve instructions for MXE 2014-02-14 20:12:09 +01:00
xylosper 87c13de656 sd_lavc: handle subtitles with no subtitle resolution set
Set subtitle resolution to video resolution when avctx->width and
avctx->height are zero.

This can happen with broken vobsubs that have no size set in their
.idx file (or Matroska extradata). At least with the test file provided
in issue #551, using the video resolution as fallback instead of what
guess_resolution() does is better.

Note that these files clearly are broken. It seems this particular
file was created by trying to use ffmpeg to transcode DVB subtitles
to vobsub, and ffmpeg "forgot" to set the subtitle resolution in the
destination file. On the other hand, ffmpeg DVB and PGS decoders set
the resolution on the first subtitle packet (or somewhere close), so
it's not really clear what to do here.

Closes #551.

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

Patch by xylosper, rewritten commit message by wm4.
2014-02-14 16:38:31 +01:00
wm4 ce6fb9175c options: make --no-config block all auto-loaded configuration files
Until now, the --no-config was explicitly checked in multiple places to
suppress loading of config files.

Add such a check to the config path code itself, and refuse to resolve
_any_ configuration file locations if the option is set.

osc.lua needs a small fixup, because it didn't handle the situation when
no path was returned. There may some of such cases in the C code too,
but I didn't find any on a quick look.
2014-02-14 14:01:27 +01:00
wm4 c2e8f8fb89 lua: auto-load scripts from ~/.mpv/lua/
This is like passing them to --lua.
2014-02-14 14:01:27 +01:00
wm4 414c4f9322 lua: make register_event() not overwrite previous event handler
Instead, chain them.

Note that there's no logic to prevent the other event handlers to be run
from an event handler (like it's popular in GUI toolkits), because I
think that's not very useful for this purpose.
2014-02-14 14:01:27 +01:00
Diogo Franco (Kovensky) 99e38aee9a build: Add -U__STRICT_ANSI__ to CFLAGS on Cygwin
Cygwin's libc (newlib) doesn't obey a lot of unix feature test macros,
including _GNU_SOURCE; as a result, a lot of functions and defines get
masked out -- important defines such as M_PI and strcasecmp. Work around
it by undefining __STRICT_ANSI__ on cygwin systems.

This will still cause compilation issues on any non-cygwin system that
uses newlib, but hopefully nobody does that, or if they do, they will
find this commit message and know to add -U__STRICT_ANSI__ to their
CFLAGS. Hopefully.
2014-02-13 19:29:23 -03:00
Stefano Pigozzi 590b28c08b build: disable clang's tautological compare warnings [2]
Fixup 8009646583.
2014-02-13 23:16:12 +01:00
wm4 2a2dfd2327 sub: handle vobsub-in-mp4
The mplayer decoder (spudec.c) actually handled this. There was explicit
code for binary palettes (16 32 bit values), and the subtitle resolution
was handled by video resolution coincidentally matching the subtitle
resolution.

Whoever puts vobsub into mp4 should be punished.

Fixes the sample gundam_sample.mp4, closes github issue #547.
2014-02-13 22:54:47 +01:00
Stefano Pigozzi 8009646583 build: disable clang's tautological compare warnings
This silences two non issues in the client.c file. Fixing them as clang would
want us to, would introduce security bugs and potential crashes.
2014-02-13 22:43:17 +01:00
Stefano Pigozzi 2705c66799 cocoa: fix deadlock during initialization [2]
Fixup commit for 20fa191ad.
2014-02-13 22:22:44 +01:00
wm4 098f0c67e6 player: select subtitles added with sub_add
In particular, this affects drag & drop of subtitles, which uses sub_add
internally. This will make the subtitles show up immediately, instead of
requiring manual selection of the added subtitle.

Might be not so ideal when adding multiple subtitles at once, because
that leads to multiple sub_add commands, and will end up with the last
subtitle instead of the first selected. But this is a minor detail.
2014-02-13 13:30:31 +01:00
wm4 adfda51e8a build: bump libmpg123 version
The minimum required version was bumped in the old configure script, but
for the waf build system is was somehow forgotten or overlooked.
Probably happened while the waf build system was developed in a separate
branch.

Closes #546.
2014-02-13 13:30:30 +01:00
Stefano Pigozzi 20fa191adb cocoa: fix deadlock during initialization
Thanks to @wm4 for catching the bug.

Fixes #405
2014-02-13 13:01:51 +01:00
nand 55f4b592d1 vo_opengl: make :srgb decompand the BT.709 values correctly
This is the same issue as addressed by 257d9f1, except this time for
the :srgb option as well. (257d9f1 only addressed :icc-profile)

The conditions of the srgb_compand mix() call are also flipped to
prevent an off-by-one error.
2014-02-12 22:00:42 +01:00
wm4 958455ac39 vo_wayland: silence shadowing warning 2014-02-12 22:00:23 +01:00
wm4 b8901bf04d command: fix metadata property
This crashed when retrieving the raw property value. Oops.
2014-02-12 22:00:23 +01:00
wm4 914f281bcb manpage: reformat property list
Use a list instead of a table. This makes it easier to provide extended
information about a property, and doesn't require you to fiddle with rhe
RST ASCII-art tables.

Also, extend some property descriptions.
2014-02-12 22:00:22 +01:00
wm4 69769860c2 manpage: lua: move less important events to the end of the list 2014-02-12 22:00:22 +01:00
wm4 b71d492555 manpage: lua: document receiving of terminal messages 2014-02-12 22:00:18 +01:00
wm4 c342dcf096 manpage: lua: rewrite event description
Using such a small table is not such a great idea, because you can't put
much information in it, even if you need to.
2014-02-12 22:00:13 +01:00
wm4 5af8070a97 client API: fix description of mpv_event.error field
The description was a left over from an earlier iteration of the API.
2014-02-12 22:00:13 +01:00
wm4 3abbe31d6b manpage: lua: minor fixes 2014-02-12 22:00:07 +01:00
wm4 623cffdce9 player: fix --force-window on OSX
The initialization code was split and refactored for the libmpv changes.
One change, moving a part of cocoa initialization, accidentally broke
--force-window on OSX, which creates a VO in a certain initialization
stage. We still don't know how cocoa should behave with libmpv, so fix
this with a hack to beat it back into working. Untested.
2014-02-11 20:11:05 +01:00
Alexander Preisinger 5020395c83 man: update wayland options 2014-02-11 18:55:25 +01:00
Alexander Preisinger 0920dc1e26 wayland/shm: rewrite buffer handling
I was unhappy with the old way of handling buffers, especially resizing. But my
original plan to use wl_shm_pool_resize wasn't as good as I initially thought.
I might get back to it.

With the new buffer pools it now possible to select triple buffering. Also the
buffer pools are also needed for the upcoming subsurfaces for osd and subtitles.

I hope this change was worth it.
2014-02-11 18:44:53 +01:00
Alexander Preisinger 0670c541a5 wayland/shm: prevent the window from flying away
With the new xdg_shell the problem will be no gone by itself.
2014-02-11 18:11:14 +01:00
wm4 157d470b31 manpage: fix Lua script shutdown description again
It was split at the wrong sentence.

Also, sneak in a reference to mp.suspend.
2014-02-11 17:41:14 +01:00
wm4 3c13e68a28 manpage: document --aspect special values
Use of these is "discouraged", but they're there to select these special
cases with the "aspect" property. They really should use some sort of
choice option type, but since it would be some work to make these work
with float values, the simple and dumb alternative was picked.
2014-02-11 17:38:55 +01:00
wm4 7448d1958d video: fix --no-aspect
This also affects the --aspect option and the "aspect" property.
2014-02-11 17:36:25 +01:00
wm4 00bb8083ed build: add SONAME to libmpv.so 2014-02-11 15:24:49 +01:00
wm4 37a4e6b583 manpage: use Lua for Lua example 2014-02-11 15:22:02 +01:00
wm4 891f58e834 manpage: document mp.commandv Lua command 2014-02-11 01:25:26 +01:00
wm4 c776ac33e3 manpage: move description of script shutdown to a separate paragraph
No other changes, just adding a paragraph break and reflowing the text.
2014-02-11 01:25:15 +01:00
wm4 d473933923 manpage: fix formatting of example code 2014-02-11 01:14:08 +01:00
wm4 0ed6644ded manpage: document some Lua scripting functions 2014-02-11 01:05:05 +01:00
wm4 212d4e6061 lua: some minor API changes 2014-02-11 00:57:40 +01:00
wm4 33c6cbef3a lua: add set_property function 2014-02-11 00:23:10 +01:00
wm4 444f79d86f lua: change error behavior
Return the error Lua-style, instead of raising it as Lua error. This is
better, because raising errors is reserved for more "fatal" conditions.
Pretending they're exceptions and trying to do exception-style error
handling will just lead to pain in this language.
2014-02-11 00:10:25 +01:00
wm4 7a53dd5f2f lua: rename some API functions
send_command     -> command
send_commandv    -> commandv
get_timer        -> get_time
property_get     -> get_property
property_get_string -> get_property_osd
getopt           -> get_opt
2014-02-11 00:01:57 +01:00
wm4 2868fbea3f av_log: add tons of warnings against mismatched ffmpeg/libav libraries
Print a warning if a library has mismatched compile time and link time
versions.

Refuse to work if the compile time and link time versions are a mix of
ffmpeg and libav. We print an error message and call exit(). Since we'd
randomly crash anyway, I think this is ok.

This doesn't catch the case if you e.g. use a ffmpeg libavcodec and a
libav libavformat, which would of course just crash as quickly, but I
think this checks enough already.
2014-02-10 23:28:10 +01:00
wm4 476a4a378a av_log: restructure version printing code
Makes the following commit simpler.
2014-02-10 23:11:30 +01:00