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.
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.
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.)
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.
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.
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.
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.
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).
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.
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.
The uninitialized values are passed through some functions, but will be
eventually unused. Initialize them anyway to avoid potential undefined
behavior and for clarity.
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().
"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.
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 "/".
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.
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.
For reasons unknown to me, vo_gl had a special case for when the -wid
option (slave mode embedding) and -geometry was used. This adjusted the
viewport in a way different from normal operation. It's unknown what
this was needed for (if it's sane at all), but since no other VOs use
this special case, and since we broke slave mode compatibility anyway,
remove it.
With anamorphic video (display with non-1:1 PAR, e.g. DVD), the display
size was passed using the mp_image fields w/h, which was blatantly
incorrect. w/h are the normal image dimensions, while width/height are
the "uncropped" storage size (used internally by vf.c).
Add a display_w/h, and use that for the display size. Make all VOs that
can do screenshots use it.
This removes the hack that screenshot_save() got the colorspace
information from the decoder. Instead, require the VOs to set the
colorspace information on the mp_images used to pass around the
screenshot data. This is more correct, as the image may have been
converted/modified in the video filter chain, although there's
nothing yet in the video filter chain which does this correctly.