Commit Graph

34202 Commits

Author SHA1 Message Date
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
reimar a0d7595206 libmpcodecs: fix coverity issues
Fix check for empty log file (n contains a start offset of 15).

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

Add missing ().

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

Conflicts:
	libmpcodecs/vf_down3dright.c

Add comment to silence coverity (and it generally doesn't
hurt to make intentional fallthrough cases explicit).

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

Make uninit function handle vf->priv being NULL.

This happens in the case where memory allocation for it fails.

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

Remove useless variable.

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

Conflicts:
	libmpcodecs/vf_softpulldown.c
2012-10-30 19:50:20 +01:00
ib 1215f0871c stream: add STREAM_CTRL_GET_CURRENT_TITLE
Add new stream control command STREAM_CTRL_GET_CURRENT_TITLE for DVDs.

This provides the current title (aka track) number of a DVD.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35263 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:20 +01:00
ib d509a7867b cache: enable STREAM_CTRL_GET_NUM_TITLES
Allow STREAM_CTRL_GET_NUM_TITLES with cache enabled.

This is missing in r34474.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35258 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:19 +01:00
reimar 43c7c3c041 vf_screenshot: fix handling of out-of-order slice rendered frames
Fix handling of out-of-order slice rendered frames.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35208 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:19 +01:00
reimar 7b5e4a8044 vf_delogo, vf_unsharp: clear mpi->priv for consistency
For consistency clear mpi->priv after it was used.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35203 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:19 +01:00
reimar bed026b9e3 vf_delogo: fix using with numbered mpi
Fix delogo filter with numbered mpi.

Should fix bug #2087.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35202 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:19 +01:00
reimar ef15c9c8ee demux_ts: fix reading teletext language
Fix reading language from teletext descriptor when it is not
the first descriptor in the block.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35198 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:19 +01:00
reimar b7462fe2da demux_ts: cosmetics
Remove "inline" from functions that are definitely not
absolutely critical for performance.

The compiler should be able to make a more intelligent
decision on its own.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35197 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:19 +01:00
reimar 2e663a3181 mp_image: update description of MP_IMGFLAG_READABLE
Update description of MP_IMGFLAG_READABLE.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35150 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:19 +01:00
reimar 1cb11c53b6 vf: fix usage count for passthrough-only filters
Fix usage count for passthrough-only filters.

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

Conflicts:
	libmpcodecs/vf.c
2012-10-30 19:50:18 +01:00
reimar 1b57e80cb8 vd_ffmpeg: detect broken mpi usage count
Detect broken mpi usage count also in decoder.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35134 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:18 +01:00
cehoyos 354b118b28 demuxer: add missing newline in error message
Add missing newline in error message.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35120 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:18 +01:00
reimar 5aab9eafb0 cache: fix long hangs
Avoid sleeping 0 ms, this can cause sleep to be not called at all.

This will then cause long hangs e.g. when sleeping on single-CPU/core computers.
Should fix bug #2084.
Patch suggested by Visenri [visenri yahoo es]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35119 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:18 +01:00
reimar 9b8967a7de demux_lavf: support SRT subtitles
Support subrip format subtitles.

Patch by Philip Langdale [philipl overt org].

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

Conflicts:
	libmpdemux/demux_lavf.c
2012-10-30 19:50:18 +01:00
reimar 570c907609 demux_lavf: do not special case ID_TEXT subs on program switching
When switching programs select subtitle stream regardless of
whether the format is text, ASS, bitmap or whatever.

There probably was some good reason for the condition but
it got lost in time and special-casing CODEC_ID_TEXT over other
test-based subtitles doesn't seem to make much sense.

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

Conflicts:
	libmpdemux/demux_lavf.c
2012-10-30 19:50:18 +01:00
reimar ff08d0c34a stream_file: explicitly signal EOF
Explicitly signal EOF when reaching the end of a file/pipe.

Fixes a 4 second delay due to stream_reconnect for e.g.
echo | mplayer -

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