Commit Graph

34202 Commits

Author SHA1 Message Date
wm4 b7052b431c command: add sub_reload and sub_remove commands
sub_remove remove an external subtitle track, for whatever this may be
needed.

sub_reload removes and re-adds an external subtitle track.

Also rename sub_load to sub_add, because that seems to be more in line
with sub_remove.
2012-11-16 21:21:15 +01:00
wm4 dd7dc2ee3d subreader: replace sub_free() by talloc destructor
Makes it less annoying to free the sub_data.
2012-11-16 21:21:15 +01:00
wm4 25a098fe78 options: add --mute for setting initial audio mute status
Similar to --volume. Takes this as opportunity to move the variable
corresponding to --volume into MPOpts.
2012-11-16 21:21:15 +01:00
wm4 1197e13c2f options: rename -sub-fuzziness to -autosub-match, change option values
"--autosub-match" is close to "--autosub", and reflects what this
option does slightly better. Replace the magic number option values
with choices:

--sub-fuzziness=0  becomes --autosub-match=exact
--sub-fuzziness=1  becomes --autosub-match=fuzzy
--sub-fuzziness=2  becomes --autosub-match=all
2012-11-16 21:21:15 +01:00
wm4 2b851c6ed3 options: rename --cursor-autohide, replace magic number values
--cursor-autohide-delay=-2   becomes --cursor-autohide=always
--cursor-autohide-delay=-1   becomes --cursor-autohide=no
--cursor-autohide-delay=123  becomes --cursor-autohide=123
2012-11-16 21:21:15 +01:00
wm4 269f7df18b options: --field-dominance: replace magic number values with choices
--field-dominance=-1  becomes --field-dominance=auto
--field-dominance=0   becomes --field-dominance=top
--field-dominance=1   becomes --field-dominance=bottom
2012-11-16 21:21:15 +01:00
wm4 51503a0577 options: rename -ss and -endpos, allow relative times
Rename the -ss option to -start, and -endpos to -length. Add a -end
option. The -end option always specifies an absolute end time, as
opposed to -endpos/-length.

All these options (--start, --end, --length) now accept relative times.
Percent positions (e.g. "--start=30%") are interpreted as fractions of
the file duration. Negative times (e.g. "--start=-1:00) are interpreted
relative to the end of the file. Chapters (e.g. "--start=#3") yield the
chapter's time position.

The chapter support might be able to replace --chapter completely, but
for now I am not sure how well this works out with e.g. DVDs and BDs,
and a separate --chapter option is useful interface-wise.
2012-11-16 21:21:15 +01:00
wm4 b4b86e9286 cookies: don't read cookie files from ancient browsers
Remove the code that attempted to read cookie files from well-known
browser locations. This code was written for ancient browsers, and only
knew about Mozilla and Netscape. While it's possible that these browsers
are still alive and still use the same config locations and cookie file
formats, the only Mozilla-based browser that still matters is Firefox.
Firefox uses a sqlite database for cookies, located in a slightly
different config path.

Just remove this code.
2012-11-16 21:21:15 +01:00
wm4 db45c8771a options: respect --no-msgcolor during early program start
Using --no-msgcolor, error messages that happened before "really"
parsing the command line were still printed in color. Add the
CONF_PRE_PARSE flag to make this option take effect as early as
possible.
2012-11-16 21:21:15 +01:00
wm4 2628ff6224 options: remove --display
Was used to set the X11 display. XDisplayName(NULL) does the same,
using the DISPLAY environment variable instead.
2012-11-16 21:21:15 +01:00
wm4 a540881571 options: rename --xineramascreen to --screen, remove magic values
--xineramascreen=-2 becomes --screen=all
--xineramascreen=-1 becomes --screen=current
2012-11-16 21:21:15 +01:00
wm4 dc0e610677 options: remove --osdlevel in favor of --osd-level
--osdlevel has been documented as renamed/removed. Not actually
removing it was probably an oversight.
2012-11-16 21:21:15 +01:00
wm4 1fa1ff7880 video/filter: rename vf_eq2 to vf_eq
vf_eq was deleted earlier, which makes the name vf_eq2 even more
awkward.
2012-11-16 21:21:14 +01:00
wm4 11ec5f19f2 vo_opengl: remove osdcolor suboption
This wasn't actually used since the old gray-alpha OSD rendering has
been removed. Removing the documentation for the vo_opengl_old osdcolor
suboption was forgotten as well.
2012-11-16 21:21:14 +01:00
wm4 53ee9aa6ae options, vo_x11: remove -zoom option, make it default
The -zoom option enabled scaling with vo_x11. Remove the -zoom option,
and make its behavior default. Since vo_x11 has to use libswscale for
colorspace conversion anyway, which doesn't do actual extra scaling when
vo_x11 is run in windowed mode, there should be no speed difference with
this change.

The code removed from vf_scale attempted to scale the video to d_width/
d_height, which matters for anamorphic video and the --xy option only.
vo_x11 can handle these natively. The only case for which the removed
vf_scale code could matter is encoding with vo_lavc, but since that
didn't set VOFLAG_SWSCALE, nothing actually changes.
2012-11-16 21:21:14 +01:00
wm4 52fe0a4fe2 configure: remove --enable-profile
The --enable-profile switch simply adds -p to the CFLAGS, which enables
gcc's extremely worthless "prof" profiling support. This kind of
profiling is broken on the conceptual level and thus harmful, and even
if you want it, you can enable it manually with --extra-cflags.

Also remove $_march $_mcpu from the CFLAGS code. These variables were
always unset, as the code setting them has been removed earlier.
2012-11-16 21:21:14 +01:00
wm4 d7de05f6c1 manpage: various fixes 2012-11-16 21:21:14 +01:00
wm4 88cfe47614 input: silence warning if input.conf is missing
It's silly to print a warning if an optional config file is missing.
Don't print anything at the default message level if an input config
is not found.

Unfortunately, the behavior is the same for explicitly passed input
config files (with --input=conf=file.conf).
2012-11-16 21:21:14 +01:00
Rudolf Polzer eb12bc4c21 encoding examples: change global_quality use to qscale
global_quality would need an extra multiplication by QP2LAMBDA otherwise
2012-11-15 15:42:06 +01:00
wm4 50db7b7f75 mplayer: do not freeze when trying to loop an unseekable file
Using --loop=inf on an unseekable file would put mpv (and all other
mplayers as well) into an endless loop, trying to seek to the start of
the file on each playback loop iteration. When the seek fails, playback
simply remains in the at-end-of-file state, and tries to issue a new
seek command for looping.

Fix by checking if the seek command fails, and abort looping in this
case. For that, queue_seek() is replaced with seek(). Due to the
circumstances, these two calls happen to be equal in this case: the
seek is absolute (i.e. no seek coalescing done), and the execution of
queued seeks is right after the loop code anyway.
2012-11-14 13:46:40 +01:00
wm4 8827a4090e options: make --loop always per-file
In this example, only f1.mkv was looped: mpv f1.mkv f2.mkv --loop=2
This is because the playloop actually changes the global option value,
assuming it would be reset when going to the next file. When mpv was
changed to not reset options between files, this assumption was broken.
2012-11-14 13:28:16 +01:00
wm4 b60483a144 Makefile: don't strip by default, add install-strip targets
Now "make install" will never strip the binary. "make install-strip"
always will.

The behavior of --enable-debug is unchanged, other than having no
influence anymore on the install targets.
2012-11-14 13:06:00 +01:00
wm4 e5f7976000 video: add IMGFMT_Y16/PIX_FMT_GRAY16
This pixel format is sometimes used with yuv4mpeg.

vo_direct3d used its own IMGFMT_Y16 internally for some reason.

vo_opengl, vo_opengl_old, and vo_direct3d should be able to display
this pixel format natively.
2012-11-14 11:50:02 +01:00
wm4 a86ec72986 Makefile: do not create config directory with install target
The config directory, controlled by --confdir and which is set to
PREFIX/etc/mpv by default, should not be created by default, as
"make install" doesn't copy any files there. The user can still create
a config file manually if system-wide configuration is desired.
2012-11-14 11:48:18 +01:00
wm4 597a0c70f9 example.conf: all options should be commented
The file is written with the assumption that it doesn't change any
settings by default. Add a forgotten comment to fix this.
2012-11-14 11:48:18 +01:00
wm4 d49e8ee164 cfg-mplayer: do not include encode options when encoding disabled
Normally, we always want to enable encoding, as it uses stock ffmpeg
APIs and has no other dependencies or disadvantages.

However, supporting older releases of ffmpeg and Libav (which equal to
outdated git snapshots fix security and crash fixes applied) force us
to disable some advanced ffmpeg API usage, which includes encoding.
2012-11-14 11:47:33 +01:00
wm4 9fc682d46f Improve compatibility with Libav 0.8.4 and ffmpeg 0.11.2
Libav 0.8.4 is ridiculously old (in relative terms), so I don't know
how many things are broken silently.

Encoding is disabled, because the required API hasn't been added yet.
(On the other hand, the old API can't be used in newer versions.)

This should improve compatibility with ffmpeg 0.11.2 as well, which
didn't define AV_CODEC_ID_SUBRIP yet.
2012-11-14 11:45:52 +01:00
wm4 94fc9f7558 build: build manpage by default if rst2man is detected
Add building the manpage to the all target (which is also the default
target). This fixes the behavior that "make install" tried to build the
manpage if it wasn't built yet.

Add rst2man detection to configure, and disable rst2man usage in the all
and install targets if it hasn't been found. You can still build or
install the man page manually (by using the install-mpv-man target),
but the all and install targets won't attempt to use rst2man.

Additionally, building/installing the manpage by default can be
explicitly inhibited using the --disable-manpage configure option.
It's possible to avoid rst2man by using "make mpv install-no-man" as
well.
2012-11-14 11:26:43 +01:00
wm4 1b8ef407eb Makefile: add mpv.rst dependencies
Using a really dumb rule declaration.
2012-11-14 11:26:43 +01:00
wm4 7087fc50fc TOOLS: remove checktree.sh
Nice idea, but essentially useless. Unmaintained even in mplayer-svn.

Remove broken remains of the checkheaders target too.
2012-11-14 11:26:43 +01:00
wm4 97efafee8a build: remove doc/locale language auto-detection, simplify
This removes the rather complicated configure and Makefile parts
related to auto-detecting available languages for manpages and locales.
We don't have non-English manpages or any locales, so this is
pointless. It didn't even work: configure --language=all created an
invalid config.mak that would cause "make install" to fail.

Remove installation of locales. There are no translations at all which
could be installed. Should there ever be someone who is interested in
adding translations, this can be added back in a simpler way.

Rename the --enable-translation configure option to --enable-gettext.
This is what this option really does: enable gettext() use. This may
be interesting for people who want to experiment with localizing mpv,
but is entirely useless for normal use.

Remove detection of the binary codecs directory in configure.
2012-11-14 11:26:43 +01:00
wm4 a2098326da network: fix crash with -playlist http://...
The function fixup_network_stream_cache() accesses stream->opts, which
is NULL in some cases when loading playlists. stream->opts is a pointer
to the global MPOpts struct. For simplicity, this parameter is left
NULL in some cases. Usually, this doesn't matter, because barely
anything in stream/ uses MPOpts anyway.

Hack-fix this for now by not accessing MPOpts and disabling the stream
cache in this case. Calling open_stream() with options==NULL now
basically means: do not use cache settings.
2012-11-14 00:46:15 +01:00
Uoti Urpala dbb4a973d5 mixer: fix lowering hw volume while muted
Lowering volume while muted did not work correctly with audio outputs
that support native mute setting separate from volume (ao_alsa and
ao_pulse), because the AO-level volume was not set while muted but was
still being read back. Fix by setting the AO volume in this case.
2012-11-14 00:46:15 +01:00
Stefano Pigozzi 772afce75e ao_coreaudio: fix deprecation warnings 2012-11-13 22:19:18 +01:00
Stefano Pigozzi bec630c347 clang: fix all warnings except deprecations 2012-11-13 22:19:18 +01:00
Rudolf Polzer 9203f06cf3 vf_dlopen: fix a typo in zeroing memory (thanks, pigoz)
Accidentally had put the & inside the sizeof call too. Typing too fast.
2012-11-13 09:52:53 +01:00
Johannes Nixdorf 88ac5c5d42 Makefile: fix install targets
INSTALL_TARGETS-yes is a leftover from INSTALL_TARGETS-$(MPLAYER), which
was removed in 4873b32c59.
2012-11-13 09:40:55 +01:00
wm4 90784dfc9d win32: remove pointless get/release DC wrappers 2012-11-12 20:10:42 +01:00
wm4 5afacef0e4 Add MP_NORETURN and replace av_noreturn uses
av_noreturn is a rather recent addition to libavutil, and defining it
ourselves is trivial and makes playing compatibility games easier.
2012-11-12 20:10:23 +01:00
wm4 a6c4f2646f mp_common.h: split parts into mp_talloc.h and compiler.h
Put MP_EXPAND_ARGS() in compiler.h, even though it's not compiler
dependent. Both mp_talloc.h and mp_common.h need it, while mp_common.h
includes mp_talloc.h. This is the least annoying solution.
2012-11-12 20:08:57 +01:00
wm4 20e9d06a2f libav.h: increase compatibility by not including libavutil/version.h
libavutil/version.h was only recently split off from
libavutil/avutil.h, and that file includes version.h anyway.
2012-11-12 20:08:24 +01:00
wm4 46cf722d80 Add missing compat/libav.h includes
For avcodec_free_frame().
2012-11-12 20:08:24 +01:00
wm4 4873b32c59 Rename directories, move files (step 2 of 2)
Finish renaming directories and moving files. Adjust all include
statements to make the previous commit compile.

The two commits are separate, because git is bad at tracking renames
and content changes at the same time.

Also take this as an opportunity to remove the separation between
"common" and "mplayer" sources in the Makefile. ("common" used to be
shared between mplayer and mencoder.)
2012-11-12 20:08:18 +01:00
wm4 d4bdd0473d Rename directories, move files (step 1 of 2) (does not compile)
Tis drops the silly lib prefixes, and attempts to organize the tree in
a more logical way. Make the top-level directory less cluttered as
well.

Renames the following directories:
    libaf -> audio/filter
    libao2 -> audio/out
    libvo -> video/out
    libmpdemux -> demux

Split libmpcodecs:
    vf* -> video/filter
    vd*, dec_video.* -> video/decode
    mp_image*, img_format*, ... -> video/
    ad*, dec_audio.* -> audio/decode

libaf/format.* is moved to audio/ - this is similar to how mp_image.*
is located in video/.

Move most top-level .c/.h files to core. (talloc.c/.h is left on top-
level, because it's external.) Park some of the more annoying files
in compat/. Some of these are relicts from the time mplayer used
ffmpeg internals.

sub/ is not split, because it's too much of a mess (subtitle code is
mixed with OSD display and rendering).

Maybe the organization of core is not ideal: it mixes playback core
(like mplayer.c) and utility helpers (like bstr.c/h). Should the need
arise, the playback core will be moved somewhere else, while core
contains all helper and common code.
2012-11-12 20:06:14 +01:00
Rudolf Polzer bd48deba77 mpv_identify: stop using \n; fix property name handling
Dashes are not valid in shell variable names. This changes them to
underscores.
2012-11-12 17:54:45 +01:00
wm4 0165ab5402 vo_opengl: fix compatibility with OpenGL 2.1
The srgb_compand() function passes bvec to mix(), which is apparently
not available on GL 2.1 / GLSL 1.20:

0:0(0): error: no matching function for call to `mix(vec3, vec3, bvec3)'
0:0(0): error: candidates are: float mix(float, float, float)
0:0(0): error:                 vec2 mix(vec2, vec2, vec2)
0:0(0): error:                 vec3 mix(vec3, vec3, vec3)
0:0(0): error:                 vec4 mix(vec4, vec4, vec4)
0:0(0): error:                 vec2 mix(vec2, vec2, float)
0:0(0): error:                 vec3 mix(vec3, vec3, float)
0:0(0): error:                 vec4 mix(vec4, vec4, float)

Also add back disabling color management on older GL, as the
srgb_compand() function is needed for that.
2012-11-12 00:27:26 +01:00
nand a558117909 vo_opengl: fix srgb for subtitles
Based on a patch by nand. This is needed, because sRGB mode changes the
video over-all gamma. This has to be done for subtitles as well.
The final srgb_compand() call in the OSD shader compensates for the fact
that in ed8fad729d framebuffer use was replaced with doing sRGB
conversion manually by srgb_compand().

This only affects subtitles rendered with libass. Nothing is changed for
RGB subs.

Also change the USE_ flags for OSD shaders to USE_OSD_ to make the
difference between video and OSD rendering more apparent.
2012-11-11 21:34:58 +01:00
wm4 a400c8ff84 vo_xv: don't call vo_xv_get_eq() on every frame
This was done to query the colorspace for sub/OSD rendering. A
single vo_xv_get_eq() call probably requires a dozens of round-trips
(depending what xlib actually does). This likely wasn't a real problem,
but it might be better to be paranoid about this.
2012-11-11 18:40:43 +01:00
wm4 c12f408c47 example.conf: remove some useless options, add some useful ones 2012-11-11 18:10:14 +01:00
wm4 e2eaedcb0a vo_opengl: disable extended downscaling by default
To simplify implementation, the same filter kernel was used for both
directions, even when the scaling factors were different. It turns
out that people actually did this, and that the resulting rendering
errors were rather visible. Disable this feature by default, as
fixing it would require structural changes, and it's a useless anyway.
2012-11-11 18:02:07 +01:00