Commit Graph

34136 Commits

Author SHA1 Message Date
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
wm4 3466057feb vo_vdpau: remove unneeded assignment to vo_fs
This is already done by x11_common.c. Other X11 VOs don't touch the
vo_fs variable directly.
2012-11-01 02:07:46 +01:00
wm4 8afa8c1ce5 vo_opengl, vo_opengl_old: remove -wid/viewport special case
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.
2012-11-01 02:07:46 +01:00
wm4 caa64363c5 image_writer: add dump_png() function as debugging helper 2012-11-01 02:07:45 +01:00
wm4 c62efc52c6 screenshot: remove hack for passing anamorphic image size
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.
2012-11-01 02:07:45 +01:00
wm4 738aeb1c60 screenshot: let VOs pass colorspace information via mp_image
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.
2012-11-01 02:07:45 +01:00
wm4 9ba52ea6ef screenshot, draw_bmp: use colorspace passed with mp_image
Remove the explicit struct mp_csp_details parameters from all related
functions, and use mp_image.colorspace/levels instead.
2012-11-01 02:07:45 +01:00
reimar 83f8d34a07 demux_ts: remove some incorrect usages of realloc_struct
Remove some incorrect usages of realloc_struct.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35318 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:46:40 +01:00
reimar 6c141b60b5 subreader: do not write outside array bounds
Extra checks to ensure we really do not write outside
array bounds.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35313 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:45:38 +01:00
reimar 86a5b7a4cc cookies: replace sprintf with snprintf
Use snprintf instead of sprintf.

No good reason beyond paranoia and Coverity complaining about it.
In a very theoretical, construed case the adds might overflow
or the environment might change in-between the getenv calls.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35307 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:45:04 +01:00
reimar 7d5a6b9b02 stream_cddb: replace sprintf with snprintf
Replace sprintf with snprintf.

To my knowledge the only "real" issue this fixes
is that setting certain environment variables to
very long strings might have caused overflows.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35306 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:44:05 +01:00
upsuper a169aa6364 af_hrtf: clamp output to relieve noises
This patch relieves noises from af_hrtf by using av_clip_* instead of
casting directly. There are still some noises, which indicates other
bugs inside this filter.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35304 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:43:46 +01:00
reimar 78899a096f spudec: set pointers to NULL after free
Set pointers to NULL after free.
For the pal_image one it would have been possible
to leak the old pointer of the malloc for "image" failed.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35303 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:43:26 +01:00
reimar 5d44d445ef input: fix off-by-one error
Fix off-by-one error in range check.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35302 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	input/input.c

This code is already quite different from mplayer-svn, but still the
same bug.
2012-10-31 22:41:48 +01:00
reimar 1ad5f3f0a4 ao_oss: make error check slightly more correct
Only a return value of -1 indicates an error for open(),
purely theoretically the mixer device could get 0 assigned
as file descriptor.
Even more theoretically, WinCE uses descriptors with values < 0,
though that probably is non-conformant behaviour.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35295 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:37:48 +01:00
reimar 3bebbe066d geometry: remove useless NULL check
Remove useless checks, the code would crash all over of widw/widh were NULL.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35292 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:36:37 +01:00
wm4 334db4cad2 mplayer: mark exit_player as noreturn
Similar to mplayer-svn commit r35291.
2012-10-31 22:35:48 +01:00
reimar d02b8191bf vo_vdpau: fix off-by-one error
Fix off-by-one error in check.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35287 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	libvo/vo_vdpau.c
2012-10-31 22:33:51 +01:00
reimar 5c72ff6a25 x11_common: make some variables static
Make some variables static.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35285 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:31:52 +01:00
reimar 17f2166b73 x11_common: make modecount variable global
Since the modecount variable is only ever initialized when the videmodes
variable is, it also has to be a global variable.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35284 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:30:09 +01:00
wm4 e2a9215e9b config: better error reporting, make invalid option values non-fatal
Always print config file location and line number on config file parse
errors. Print an error message with fatal log level if parsing failed
completely.

Setting an option to an invalid value in config files made loading these
files fatal. There isn't really any need to make this a fatal error.
Change it so that these cases don't abort loading. This is also more
consistent with missing options. These weren't fatal either.
2012-10-31 02:03:18 +01:00
wm4 ef93036d30 commands: fix audio-delay property
SET simply didn't set the variable correctly.

Chain the property as generic option, so the property code will return
the correct type for the property, as well as implement the GET part.
2012-10-30 20:26:00 +01:00
wm4 6403ecdf87 commands: make media-title property return filename in default case
Instead of the full path.
2012-10-30 20:13:28 +01:00
wm4 e5f96e9845 fmt-conversion: guard ffmpeg-only pixel format
This should fix compilation with libav.
2012-10-30 20:13:28 +01:00
wm4 a42aae3bf8 cleanup: remove some things related to old video decoders 2012-10-30 20:13:28 +01:00