Commit Graph

34160 Commits

Author SHA1 Message Date
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
wm4 eb6688724c Replace fast_memcpy() uses
fast_memcpy, defined in fastmemcpy.h, used to be mplayer's "optimized"
memcpy. It has been removed from this fork, and fast_memcpy has been
reduced to an alias for memcpy. Replace all remaining uses of the
fast_memcpy macro alias.
2012-11-11 17:56:42 +01:00
wm4 34649dbd1d manpage: vo_opengl: document that srgb subopt changes gamma 2012-11-11 17:56:42 +01:00
nand ed8fad729d vo_opengl: add manual sRGB companding to not artifact when dithering
Patch by nand. Modified not to use macros in the GLSL, and also remove
the checks for framebuffer presence. (Disabling ICC if no sRGB
framebuffer is available was probably a bug.)
2012-11-11 17:56:42 +01:00
Stefano Pigozzi c78243c03e cocoa_common: honor the `--geometry` option 2012-11-10 22:37:19 +01:00
Stefano Pigozzi 05650110f3 ao_coreaudio: signal per-application mixer support
The CoreAudio AO's AOCONTROL_GET_VOLUME/AOCONTROL_SET_VOLUME operate on the
AUHAL's volume, and every application has it's AUHAL with a separate volume.

Additionally CoreAudios's mixer seems to be better. As much as I tried to, I
couldn't get it to clip sounds.
2012-11-08 23:52:35 +01:00
Kovensky d53d75e080 demux_mkv: TTA support
Code from libavformat's demuxer.

Merged by wm4. It looks like the byte stream writer API is private in
newer ffmpeg, so use the macros from <libavutil/intreadwrite.h>
instead.

It's not really known how to correctly set the field that is used by
the decoder to calculate the length of the last frame. The original
patch used:

    put_le32(&b, (demuxer->movi_end - demuxer->movi_start) * sh_a->samplerate);

This doesn't seem to be correct. Write 0 instead. This is also
incorrect, but better than writing an essentially random value.
2012-11-08 01:39:32 +01:00
wm4 ed2c54cea9 demux_mkv: don't crash on tracks with unknown audio codecs
Demuxers can't remove streams anymore after adding them, so the
free_sh_audio() call caused a crash.
2012-11-08 00:32:49 +01:00
Kovensky fae7307931 Port several python scripts to Perl
file2string.pl and vdpau_functions.pl are direct ports.
matroska.py was reimplemented as the Parse::Matroska module in CPAN,
and matroska.pl was made a client of Parse::Matroska.
A copy of Parse::Matroska is included in TOOLS/lib, and matroska.pl
looks there first when trying to load the module.

osxbundle.py was not ported since I have no means to verify it.
Python is always available on OSX though, so there is no harm in
removing the check for it on configure.
2012-11-08 00:28:59 +01:00
wm4 58f821e096 vd_ffmpeg: disable codec direct rendering and slices by default
This caused failures when doing single threaded decoding in some cases.
It's unknown what exactly the reasons are for these failures, but
direct rendering is probably worthless anyway.

Disable slices by default as well, just to be sure not to invoke broken
code paths. Multithreading disables these too.

The old behavior can be restored by passing the -dr1 -slices command
line options. (-dr1 is left undocumented intentionally.)

Multithreaded decoding worked fine, because vd_ffmpeg.c automatically
disables direct rendering in this case.
2012-11-07 23:29:55 +01:00
Stefano Pigozzi a20c9576be osxbundle: run install_name_tool -id only on direct dependencies
It looks like that only `install_name_tool -change` must be applied
recursively. This allows to bundle up all our stuff without thinkering with
the Mach-O headerpad size (which could even be impossible for libraries we
don't compile and link ourselves).
2012-11-06 00:06:16 +01:00
Stefano Pigozzi 3043690756 cocoa_common: save vo struct earlier in the startup process
This prevents a crash with -fs option.
2012-11-05 22:03:15 +01:00
Stefano Pigozzi e6a6a60276 libav_compat: fix mmx2 define, provide fallback for avcodec_free_frame 2012-11-03 18:22:56 +01:00
Stefano Pigozzi 6e6fc03828 libav_compat: add missing includes 2012-11-03 15:50:15 +01:00
Stefano Pigozzi f79b08bf57 make compile with recent libav 2012-11-03 12:17:13 +01:00
Stefano Pigozzi 11173115bb uncrustify af.h
used `uncrustify -l C -c TOOLS/uncrustify.cfg --no-backup --replace libaf/af.h`
2012-11-02 19:20:03 +01:00
Stefano Pigozzi 593e433cc8 audio: untypedef af_stream 2012-11-02 19:20:03 +01:00
Stefano Pigozzi 30f3b537b2 audio: untypedef af_cfg 2012-11-02 19:20:03 +01:00
Stefano Pigozzi c9b5954851 audio: untypedef af_instance 2012-11-02 19:20:03 +01:00
Stefano Pigozzi 596e12fcb2 audio: untypedef af_info 2012-11-02 19:20:03 +01:00
Stefano Pigozzi 0374ddb79d audio: untypedef af_data and rename it to mp_audio
this is to have something specular to mp_image
2012-11-02 19:19:28 +01:00
Stefano Pigozzi e0aef8cf12 configure: detect rst2man binary name 2012-11-02 14:37:02 +01:00
Rudolf Polzer 538baaef6e encode: bail out on missing A or V stream
In mplayer2, it was valid to try to start encoding before all streams
were initialized. mpv avoids this situation and thus allows us to
properly bail out on some kinds of failures.

Also, this commit fixes a missing check in ao uninit which could cause
heap corruption when ao initialization did not complete.
2012-11-01 12:29:55 +01:00
wm4 84829a4ea1 Merge branch 'osd_changes' into master
Conflicts:
	DOCS/man/en/options.rst
2012-11-01 02:12:47 +01:00
wm4 e45dd051c3 ao_alsa: make code less confusing
The call snd_pcm_hw_params_alloca(&alsa_hwparams) expands to a macro,
which actually uses alloca(), and stores its result to alsa_hwparams.
At the same time, alsa_hwparams was a global variable for no good
reason. Make it less confusing and move the variables into the init()
function, where they are needed.
2012-11-01 02:12:18 +01:00
wm4 741ab39510 stream: open_stream_plugin() should set error code on failure
clang analyzer complained about *ret (&r) containing garbage in
open_stream_full(). This should fix it.
2012-11-01 02:12:18 +01:00
wm4 e57802a39f gl_common: add dummy initialization
The uninitialized values are passed through some functions, but will be
eventually unused. Initialize them anyway to avoid potential undefined
behavior and for clarity.
2012-11-01 02:12:18 +01:00
wm4 fc656c6bcc ad_spdif: don't print uninitialized value in debug message 2012-11-01 02:12:18 +01:00
wm4 c6ce1d4b99 gl_common: make glFmt2bpp() abort on unknown formats
None of its callers actually checked the return value, and it's a given
that they call it only if it can't fail. Replace the non-sense return
value (0) by a call to abort().
2012-11-01 02:12:18 +01:00
wm4 c59a80b77c vf: fix NULL pointer issue
"mpi" was accessed right after the if block, that checked that mpi is
not NULL. Either the check is uneeded, or the access to "mpi" always
crashes. Just move the access inside the checked block.
2012-11-01 02:12:18 +01:00
wm4 1809cbcc90 input: minor simplification 2012-11-01 02:12:18 +01:00
wm4 cb77400006 vd: minor simplification 2012-11-01 02:12:18 +01:00
wm4 9643590889 m_option: minor simplification
Relict of mplayer's C89 compatibility?
2012-11-01 02:12:18 +01:00
wm4 bba1edfca5 vo_x11: remove dead assignment 2012-11-01 02:12:18 +01:00
wm4 29cc099297 mplayer: remove useless timer calls
GetTimer() has no side-effects. Probably left over from --benchmark
removal.
2012-11-01 02:12:18 +01:00
wm4 826c19f706 parser-mpcmd: minor simplification
Note that we don't care that mpv prints "fatal error" as exit reason
when help was requested and printed (e.g. "mpv -h").
2012-11-01 02:12:18 +01:00
wm4 2b35fc13ed http: fix potential NULL pointer issue
Found by clang analyzer. This called strlen(NULL), if the uri field
in the http_hdr wasn't set. It seems all callers of this function set
the field properly, so remove the bogus fallback to "/".
2012-11-01 02:12:17 +01:00
wm4 73f866e7eb tl_matroska: fix NULL pointer issue
Found by clang analyzer. Probably doesn't matter in practice, because
the number of entries was 0 when entries was NULL.
2012-11-01 02:12:17 +01:00
wm4 0212d7e804 http: fix potential NULL pointer issue
Found by clang analyzer. Untested.
2012-11-01 02:12:17 +01:00
Uoti Urpala 02daf37328 demux_mkv: fix a hang with invalid files
ebml_read_length() could return a negative value (as uint64_t though)
at EOF, and this would then make ebml_read_skip() seek backwards. This
could lead to an infinite loop at EOF with corrupt files. Add an extra
check to make ebml_read_length() return EBML_UINT_INVALID instead if
EOF is hit in the middle of parsing.
2012-11-01 02:12:17 +01:00
wm4 c5eeac6654 manpage: --codecpath was removed 2012-11-01 02:12:16 +01:00
wm4 f4069259cf draw_bmp: remove swscale bug workaround
ffmpeg ticket #1852 is fixed with 425c30dda. This didn't actually happen
in practice.
2012-11-01 02:07:46 +01:00
wm4 6f408d0d9d VO: remove code duplication for setting up mp_osd_res
vo_opengl, vo_vdpau, vo_direct3d had the code for setting up mp_osd_res
duplicated. Make things simpler by making calc_src_dst_rects() setup
the full mp_osd_res structure, instead of just "borders".

Also, rename that function to vo_get_src_dst_rects(), and make it use
mp_rect. Remove vo_rect, which was annoying because it contains
redundant members (width/height additional to right/bottom).

Add code to print the video rect etc. in verbose mode.

There should be no actual change how the video rects are calculated. The
only exception are the bottom/right subtitle margins, which are now
computed slightly differently, but that shouldn't matter.
2012-11-01 02:07:46 +01:00