Commit Graph

34268 Commits

Author SHA1 Message Date
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
wm4 62dc32250e mplayer: fix multiline terminal OSD
When an OSD message printed to the terminal was multiple lines, the
second line overwrote the status line. If that second line was shorter
than the status line, awkward looking remains of the status line were
left on the terminal.

Fix this by writing an empty status line before printing the OSD
message. This will clear the status line text.

Also, print the status line again after the OSD message is printed -
this makes output consistent with the single-line OSD message case.

Remaining caveat: only the last line of a multiline OSD message is
cleared when the OSD message is removed. But this is probably fine.
2012-10-30 20:10:24 +01:00
wm4 6367ade0b0 demux_lavf, ad_ffmpeg: don't change AVCodecContext.block_align
If block_align was 0, demux_lavf changed it to 1. This breaks at least
decoding of IMA ADPCM in LVF. Pass it through without changing instead.
(nBlockAlign as set in demux_lavf is put back into lavc's block_align
in ad_ffmpeg.)

This reverts 296f360f82. This commit gives no explanation why it does
things the way it does. But since nothing in mpv uses nBlockAlign
anymore except ad_ffmpeg, this is probably safe.
2012-10-30 19:50:24 +01:00
wm4 5f236b3a82 codecs.conf: cleanup: remove stale entry 2012-10-30 19:50:24 +01:00
wm4 219e1ab1e7 demux_lavf: add a hack to work around other hacks
mplayer (and all forks) use a single FourCC field to map codecs. This is
what sh_video->format and sh_audio->format is used for. Basically it's a
key into the codecs.conf table to find out what decoder to use. (There's
only one video codec and one major audio codec left - both libavcodec.
But we still have to deal with mapping coming from non-libavformat
demuxers.)

It seems this causes some video codecs to fail, such as WV1F in AVI [1].
demux_lavf generally throws away the codec_tag from libavformat if the
codec is MPEG-in-AVI. There are probably other cases like this. Add a
hack to enforce passing the correct codec tag when only ffmpeg demuxers
and decoders involved.

Note: the sample [1] needs to be flipped. With --demuxer=avi, this is
done correctly, because unlike demux_lavf, the demuxer uses the FourCC
directly for the sh_video->format tag, and finds the correct codecs.conf
entry (which contains the flip flag). We could just add a "whitelist" of
codec tags which can be passed through to sh_video->format, but I don't
want to do that just for such an obscure format as the sample at hand.

Note 2: when demux_lavf is used, the AVCodecContext could be passed
directly to vd_ffmpeg/ad_ffmpeg. The code to convert to/from the
internal mplayer stream headers is probably still needed, as there are
non-ffmpeg demuxers and audio decoders.

[1] http://samples.mplayerhq.hu/V-codecs/WV1F/AVI/title2.avi
2012-10-30 19:50:24 +01:00
wm4 0c95e139a9 configure: bump required ffmpeg library versions
libavutil: for av_get_packed_sample_fmt()
libavcodec: for avcodec_encode_video2()

It's actually untested whether these are really the minimum required
versions. I didn't want to bump them further yet.
2012-10-30 19:50:24 +01:00
wm4 13e84fbcec input: remove default bindings for sub_step
The sub_step command is not that useful, and accidentally hitting it
means that the subtitle delay gets completely messed up.
2012-10-30 19:50:24 +01:00
wm4 caf1398c20 command: make property "deinterlace" unavailable if deinterlacer absent
The "deinterlace" property was stuck at "no" if there wasn't actually
any switchable deinterlacer (like yadif or vdpau) in the video chain.

Also, take care of returning only 0/1 values. It appears yadif and vdpau
return their current deinterlacer mode, which is not always the value 0
or 1.
2012-10-30 19:50:24 +01:00
wm4 63a56048b2 options: remove --hr-mp3-seek
This didn't do anything anymore. Even before the internal audio demuxer
was removed, demux_lavf was used by default for mp3.

Use --hr-seek instead.
2012-10-30 19:50:23 +01:00
wm4 7985d4fd34 options: remove --adapter
This probably didn't do anything. Maybe OpenGL VOs on win32 actually
could make use of it, but even then it probably didn't work.
2012-10-30 19:50:23 +01:00
wm4 0502b69672 cleanup: remove M_OPT_NOCMD
Unused.
2012-10-30 19:50:22 +01:00
wm4 f211733123 manpage: -benchmark was renamed to -untimed 2012-10-30 19:50:22 +01:00
wm4 e719d3610d options: rename -ni to -avi-ni
The -ni option does something with the AVI demuxer only.

Also fix misleading error messages when the packet queue overflows (it
suggests using -ni, which in the typical case of playing NI AVI files
will not work, as demux_lavf is used by default).
2012-10-30 19:50:22 +01:00
wm4 042901940f options, avi: remove -loadidx/-saveidx
This was probably useless even many years ago.
2012-10-30 19:50:21 +01:00
wm4 a04ad728c5 cleanup: remove references to CONFIG_TV_DSHOW 2012-10-30 19:50:20 +01:00
wm4 bf4cf84573 cleanup: remove references to CONFIG_XVID4 2012-10-30 19:50:20 +01:00
wm4 b0317a8bee screenshot: printf format "%.*s" takes an int, not ptrdiff_t 2012-10-30 19:50:20 +01:00
reimar 82d47895e4 stream: fix redirection for proxy URLs
Fix redirection for proxy URLs.

Should fix bug #2091.

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

Conflicts:
	stream/url.c
2012-10-30 19:50:20 +01:00
cboesch 5a6dde54af url: simplify
Use mp_asprintf in make_noauth_url and make_http_proxy_url.

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

Conflicts:
	stream/url.c

Note: the mp_asprintf() function was introduced in r32970, and put
into its own files. We just put that directly into url.c, as we use
talloc_asprintf() in general, and mp_asprintf() is for url.c code only.
(Making url.c use talloc would probably result in a big mess.)

Make proxy and url parameter const in get_noauth_url and get_http_proxy_url.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32972 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: cboesch
2012-10-30 19:50:20 +01:00