Commit Graph

32868 Commits

Author SHA1 Message Date
Uoti Urpala 949626ee46 fmt-conversion.c: print name of any unrecognized pixfmt
Change the error message about unrecognized pixfmt values to include
the symbolic name of the pixfmt (available from libavutil).
2011-06-26 06:27:50 +03:00
Clément Bœsch a8b11797d8 cleanup: remove warnings under libmenu/ 2011-06-24 22:55:09 +03:00
Rudolf Polzer fbf6885395 vf_pullup, vf_yadif: pts handling fixes
vf_pullup: continue to calculate pts after detecting a seek

vf_yadif: add pts calculation for the one-frame-becomes-two mode
          (-vf yadif=1)
2011-06-24 22:31:44 +03:00
Rudolf Polzer 84d86719fc Windows: vo/input: handle WM_XBUTTONDOWN message
WM_XBUTTONDOWN is used for extra mouse buttons (mapped to button 5 and
button 6 in mplayer2). Previously only vo_directx handled this
message.  Add support to w32_common.c event handling too (used by
vo_direct3d and vo_gl/vo_gl2 on Windows).
2011-06-19 04:05:36 +03:00
Uoti Urpala 38b55f8cef demux: pad even 0-size demux packet data (fixes sd_ass crash)
sd_ass relies on there being a zero byte after packet data. However
the packet allocation routines special-cased data length 0 and left
the data pointer as NULL in that case. This could cause a crash in
sd_ass if there was an empty subtitle packet. Change the allocation
routines to stop special-casing empty data and always allocate
padding. Empty packets are not so common that special casing them
would be a worthwhile optimization.

Also fix resize_demux_packet() to use MP_INPUT_BUFFER_PADDING SIZE as
the padding size, instead of a hardcoded value of 8.
2011-06-18 20:02:39 +03:00
Uoti Urpala 6d187a73f0 ffmpeg_files/intreadwrite.h: fix AV_RL32/AV_RB32 signedness
The output type of the AV_RL32/AV_RB32 macros was signed int. The
resulting overflow broke at least some ASF streams with large
timestamps (AV_RL32 used in demux_asf.c timestamp parsing code). Fix
by adding a cast to uint32_t. This code comes from FFmpeg, and the
matching code in Libav/FFmpeg is still broken (but not used there in
most common configurations).
2011-06-15 00:10:47 +03:00
Grigori Goronzy 378ada847c sub/ass: use default style, not first style unconditionally
Turns out it's a bad idea to just always unconditionally use the first
style. Make mplayer2 use and set the style according to the track's
default_style property. Fixes the -ass-styles option broken with
recent libass versions (ticket #40).
2011-06-14 20:01:19 +03:00
Grigori Goronzy 17db5cc98f input: add useful default pointer button bindings
Add two mouse button bindings:
1) left button double click toggles fullscreen
2) right button pauses/unpauses
2011-06-14 19:58:55 +03:00
Uoti Urpala bdcf4ddf35 ao: fix crash after ao init failure (from recent 3a5fd15fa2)
If opening an audio output driver using the old API failed the
"global_ao" variable was not set back to NULL as it should have been.
This caused an assert failure the next time there was an attempt to
open such an AO (either due to fallback to another AO after the
failure or after moving to another file). Fix.
2011-05-16 01:32:26 +03:00
Uoti Urpala cbdb7e6305 vo_xvmc: drop XvMC support
Due to libavcodec changes vo_xvmc would have needed some modifications
to keep working. However, I think there's little real demand for XvMC,
so I'll just drop XvMC support. XvMC only supported MPEG-2, making it
of very limited usefulness nowadays, plus the vo_xvmc implementation
was not high quality and never worked particularly well or reliably
anyway.
2011-05-09 20:27:16 +03:00
Uoti Urpala b21e7dc7a9 audio: disallow partial samples, fix ad_pcm to comply
Add some asserts to check that decoders/filters produce complete
samples (byte amounts must be multiples of channels*datatype_size) and
that audio output drivers also accept input in complete units. Fix
ad_pcm which was known to violate this if its last input packet didn't
stop at a sample boundary.
2011-05-07 22:17:51 +03:00
Uoti Urpala daafc5a368 options: fix -profile parsing after 2db33ab48c
Commit 2db33ab48c ("options: support string list separators other
than ','") started using the "priv" field in options of string list
type to store the separator character. However, the "profile" option
has a custom type which uses the same parsing function but uses the
"priv" field for another purpose. As a result "-profile" parsing used
a "random" character as the separator instead of ','; at least uses
which depended on ',' working were likely to fail, and if the
separator used happened to be a character occurring in the profile
name then any use of -profile could break. Fix by adding a check in
the parsing function to only read the priv field if the option type is
normal string list.
2011-05-07 19:44:58 +03:00
Clément Bœsch b68f9fef32 cleanup: shut up more warnings 2011-05-06 18:33:16 +03:00
Uoti Urpala 40f6ab5064 ao_pcm, core: use new API in ao_pcm, change timing with it
Change ao_pcm to use the new audio output driver API and clean up some
of the code. Rewrite the logic controlling how playback timing works
when using -ao pcm. Deprecate the "fast" suboption; its only effect
now is to print a warning, but it's still accepted so that specifying
it is not an error.

Before, timing with -ao pcm and video enabled had two possible
modes. In the default mode playback speed was rather arbitrary - not
realtime, but not particularly fast. -ao pcm:fast tried to play back
at maximum video playback speed - mostly succeeding, but not quite
guaranteed to work in all cases. Now the default is to play at
realtime speed. The -benchmark option can now be used to get faster
playback (same as the video-only case). In the audio-only case
playback is always maximum speed.
2011-05-05 21:34:17 +03:00
Uoti Urpala 2fae42d00e ao_null: convert to new API, cleanup/rewrite 2011-05-05 04:45:44 +03:00
Uoti Urpala 3a5fd15fa2 audio output: add a new AO driver API
Add a new audio output driver API. The main change is the addition of
a context struct where data can be kept instead of using globals. The
old API remains available. This commit does not yet convert any driver
to use the new API.
2011-05-05 01:39:53 +03:00
Uoti Urpala df7825eb31 cleanup: reindent audio_out.[ch]
Reindent audio_out.c and audio_out.h. Also remove trailing '_s' from
two struct names (which are not currently used anywhere) and make the
audio_out_drivers[] table static.
2011-05-04 21:09:08 +03:00
Uoti Urpala 618f760866 input: make slave command file descriptors nonblocking
Neither fd 0 slave input (-slave) nor additional opened fds (-input
file=X) were set to nonblocking mode as they should have been. Fix.
Also rename the horribly generic USE_SELECT #define used for a
specific slave input detail.
2011-05-04 18:53:17 +03:00
Rudolf Polzer 0fff1380b1 audio: clamp sample values in float->int format conversions
Make af_format clamp float sample values to the range [-1, 1] before
conversion to integer types. Before any out-of-range values wrapped
around and caused nasty artifacts. This filter is used for all
automatic format conversions; thus any decoder that outputs floats
with possible out-of-range values would have been affected by the bad
conversion if its output needed to be converted to integers for AO.
2011-05-04 17:25:11 +03:00
Uoti Urpala 24d0d48c4a audio: avoid duplicated error messages on init failure
dec_audio.c init_audio_codec() would in one case print
"ADecoder init failed :(\n" and return failure. Its only caller
init_best_audio_codec() printed exactly the same message if the
returned result was failure. Change the latter message to say
"Could not open audio decoder %s.\n" instead. Some of the
per-open-attempt messages are kind of value about their context; this
new message should make it more clear where the attempt to open one
specific codec ends.
2011-05-03 17:25:01 +03:00
Uoti Urpala 0321d683b4 ad_ffmpeg: return failure from init() if initial decode fails
The init() method in ad_ffmpeg tries to decode some audio data after
opening the libavcodec decoder; however the method returned success
even if this part failed. Change it to return failure instead,
indicating that the codec could not be successfully opened.

This improves behavior at least with some AAC files, for which the
libavcodec decoder can be successfully initialized but decoding
packets always fails. Before the audio would be decoded with
libavcodec, producing only a constant stream of errors; after this
commit audio decoder initialization falls back to FAAD (if available)
which works for these samples.
2011-05-03 16:52:57 +03:00
Uoti Urpala 78dca64301 input/joystick.c: add #include missing from 23cb829072
There was a '#include "keycodes.h"' line missing from commit
23cb829072, which broke build with --enable-joystick.
2011-05-03 13:26:30 +03:00
Clément Bœsch e699250908 vo_svga: fix build after previous commit 6506d4ad
vo_svga.c used its static query_format() function before defining it,
but had no prototype before the use. Thus is depended on the otherwise
useless static declaration in a shared header, and broke after that
was removed. Fix by adding an advance declaration inside the file.
2011-05-03 12:21:59 +03:00
Clément Bœsch 6506d4ad84 cleanup: remove more warnings 2011-05-02 00:46:48 +03:00
Uoti Urpala 7e65428712 Merge branch 'mplayer1_changes' 2011-05-02 00:46:03 +03:00
Uoti Urpala 5c4b059f16 input: rewrite -key-fifo-size limiting logic
Instead of strictly limiting the number of total entries in the
internal fifo, make the overall buffer bigger and try to limit entries
based on how many bound commands they're expected to generate. Now
doubleclick and button down events aren't counted for that limit.
Normally the sequence down-doubleclick-up generates at most one
command, so this better matches the quantity we actually want to
limit. Also add a mechanism to clear the button combination state kept
by input.c when the fifo is full; this avoids "stuck button" problems
due to button release events being dropped.

The key combination state clearing is partially based on MPlayer 1
changes by Reimar Döffinger (though overall the effects of this commit
are quite different). It still doesn't make "stuck button" problems
completely impossible; at least if the VO gets closed while a button
was down then nothing will send a button up event or reset state.
2011-05-02 00:44:21 +03:00
Uoti Urpala b9eaafe1ed input: modify interpretation of doubleclick events
The code combining button presses into multibutton commands prevented
single click commands from triggering if a doubleclick event had been
generated from the same button press. As a result using the mouse
wheel to seek worked very badly. Special-case doubleclick events in
the event interpretation code to avoid this issue. This changes the
sequence of generated "keys" for press-release-press-release from
MOUSE_BTN0   MOUSE_BTN0-MOUSE_BTN0_DBL   MOUSE_BTN0_DBL   to
MOUSE_BTN0   MOUSE_BTN0_DBL              MOUSE_BTN0.
"Keys" like MOUSE_BTN0-MOUSE_BTN0_DBL will never be generated now; any
existing configuration files using those need to be changed.
2011-05-02 00:44:21 +03:00
Uoti Urpala 325926f9f8 command.c: fix sub_remove crash
The sub_remove slave command tried to access a NULL pointer when
removing an external subtitle file displayed with libass. Fix.
2011-05-02 00:44:21 +03:00
Uoti Urpala ed5279db29 cleanup: input.c: simplify some string handling code
Replace manual loops with strspn() / strcspn().
2011-05-02 00:44:21 +03:00
Uoti Urpala 3832d67afd cleanup: reformat input.c 2011-05-02 00:44:21 +03:00
Uoti Urpala 23cb829072 input: move all key code lists to input/keycodes.h
Move the definitions of all special key codes (those not passed by
ASCII value) to input/keycodes.h. Before they were spread between
osdep/keycodes.h, input/joystick.h, input/mouse.h and input/ar.h, plus
some special values in input.h. This was especially inconvenient as
the codes had to be coordinated to not conflict between the files.

The change requires a bit of ugliness as appleir.c includes
<linux/input.h> which contains various conflicting KEY_* definitions.
Work around this by adding a special preprocessor variable which can
be used to avoid defining these in keycodes.h.
2011-05-02 00:43:31 +03:00
cehoyos d0376729d1 codecs.conf: add Etymonix MPEG-2 I-frame codec to ffmpeg12
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33332 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:21 +03:00
reimar 84b2296c34 ad_speex: support decoding stream without header packet
Setup default speex modes, allows decoding of speex in flv which does
not contain a header packet.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33327 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:21 +03:00
reimar e7e4d1d802 commands: Fix DVD angle cycling up
Patch by 侯红勋 [houhongxun gmail com]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33317 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:21 +03:00
diego e631474c76 configure: Make largefile support non-optional
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33314 b3059339-0415-0410-9bf9-f77b7e298cf2

rpm: Delete reference to removed --enable-largefiles configure option.

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

Conflicts:

	rpm/mplayer.spec
2011-05-02 00:36:21 +03:00
reimar 95d40b3f8d cleanup: vo_fbdev: simplify some code
Simplify by using FFMAX3.

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

Simplify colormap generation code, avoid some mallocs and add frees
for one error case.

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

Use memcpy_pic instead of reimplementing it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33303 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
cehoyos fa33ca0695 codecs.conf: add Canopus SD50 (CDV5) to ffdv entry
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33301 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar 8c831a2e86 vo_fbdev: clip x/y offsets to avoid bad video placement
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33299 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar 8924d2c27d vo_fbdev: Add -geometry support reusing common code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33298 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar 6d99ffbeed codecs.conf: add Deluxe Paint Animation decoder from libavcodec
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33290 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar 57f700d19c vo_fbdev: add RGB framebuffer support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33289 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar a3bf88ddef mp_taglists.c: add CODEC_ID_ANM and CODEC_ID_AVS
Add mapping between codec ID and tag for ANM and AVS.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33288 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar b977f59609 vd_ffmpeg: Make DR work with reget_buffer without buffer_hints
Allow DR to work with reget_buffer when no buffer_hints are set.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33287 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar d09882bd74 vd_ffmpeg: handle reget_buffer in DRI failure fallback code
Allow reget_buffer to somewhat work after direct rendering failure.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33286 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
diego f8471184e8 demux_ts: Hint at -tsprobe option when no audio stream is found
patch by Godmar Back, godmar gmail com

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33271 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar aeb6ac60ae ad_qtaudio: don't run win32 loader code when it's not used
Do not try to set up the FS segment when using quicktime to decode,
it makes no sense to do that.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33259 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
cehoyos c51e9d5ae1 codecs.conf: add Kega Video (kgv1) from libavcodec
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33254 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar dbde82d0f2 sub/spudec: fix artefacts at right border of subtitles
Fix artefacts at right border of scaled bitmap subtitles by clearing
the destination to 0 first if the width is not a multiple of 8.
This is necessary because some of the optimized sub drawing functions
always draw pixels in multiples of 8, so we cannot rely on any "dirt"
in the "unused" borders being ignored.
Note that due to the way rendering works, both alpha and the image need
to be cleared.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33230 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar e617653265 options: Add dummy -shuffle option to show it in -list-options
Add dummy -shuffle and -noshuffle options so they appear in
-list-options output. These features are not implemented as options;
rather they're features of the command line parser.

Also add the CONF_NOCFG flag to the existing playlist option, which is
a similar placeholder for a command line parser feature.

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33148 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
cehoyos 673a2c7597 codecs.conf, mp_taglists: add FFmpeg Bitmap Brothers JV decoder
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33125 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:35:48 +03:00