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.
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
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
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
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
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
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.
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
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
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
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.
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.
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.
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.
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
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.
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.
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).
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