Commit Graph

32907 Commits

Author SHA1 Message Date
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
reimar a37b71dc32 cache: call stream read with at least sector size space
Ensure we always pass a buffer of at least sector size to the read
function. This is never an issue with streams that have actual
sectors, as the reads will always return a multiple of sector size and
the cache is always used in blocks of sector size. However the rtp
protocol misuses this so it can just assume it always has a
sufficiently large buffer available and thus fails without this extra
hack.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33120 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-01 16:29:57 +03:00
compn 211e93aeec codecs.conf: cleanup/unify hdv* fourccs, except vdpau
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33113 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-01 16:25:37 +03:00
Uoti Urpala 3e86228fad input: don't interrupt processing at unbound events
The input code read at most one event per input or command fd. If this
event was not bound to any recognized command then no command was
returned, and higher-level code could not distinguish this case from
there being no pending events left. As a result unbound events would
cause extra latency in event processing. Change the input code to
continue reading events until it either finds one that maps to a
command or hits EOF/error.
2011-05-01 14:44:05 +03:00
Uoti Urpala 40234b1a3c input: make stdin non-blocking for terminal input
getch2.c did not make stdin non-blocking, and relied on only being
called after select() had shown readability. Stop relying on that
assumption and set stdin to non-blocking mode. Hopefully no relevant
platform has problems with this...
2011-04-28 12:52:00 +03:00
Uoti Urpala 3b401fb07f find_subfiles: fix unintended modification of global filename
Commit a2d28010cc ("cleanup: find_subfiles.c: simplify (mainly using
bstr)") was missing a bstrdup() in subtitle search code, and thus the
code erroneously modified the original filename string passed in. As a
result anything which printed or otherwise used the filename after
that would use a lowercase-converted version instead of the actual
file name. Fix by adding the bstrdup() to operate on a local copy of
the name instead.
2011-04-28 09:44:37 +03:00
Rudolf Polzer 994b21a80a vf_*: fix pts values passed to the next filter
Many video filters failed to calculate or even just pass through pts
values for their output frames. Fix this, and also make the two
remaining filters that called vf_next_put_image() twice for the same
input frame (vf_softpulldown, vf_telecine) use vf_queue_frame() so
that e.g. framestepping properly sees both frames.

Changed filters: vf_bmovl, vf_detc, vf_divtc, vf_filmdint, vf_ivtc,
vf_lavc, vf_phase, vf_pullup, vf_softpulldown, vf_telecine, vf_tile,
vf_tinterlace.
2011-04-24 03:55:47 +03:00
Uoti Urpala 28b3cc0efe bstr.h: change BSTR() from macro to inline function
Change BSTR() from a macro producing a compound literal to an inline
function returning the same value. This works for all existing uses,
and avoids a warning from BSTR(NULL) (the macro expansion contained
strlen(NULL); this was valid code because the strlen call was never
evaluated, but still triggered a GCC warning).
2011-04-24 03:05:24 +03:00
Clément Bœsch 9790fc444e demux_ogg: fix slang selection
Commit 59fff90d94 ("options: change -alang and -slang to use string
list type") failed to change demux_ogg accordingly. Add the missing
change.
2011-04-23 05:41:45 +03:00
Uoti Urpala d6072d7408 input: sleep in event loop even if there are no input fds
The input loop select() call was only run if there was at least one
input file descriptor. However other code uses the input loop to wait;
this could result in the wait becoming a busy loop when running with
-noconsolecontrols (without that there is at least one input fd for
terminal input). Make the input loop call select() to sleep even if
there are no input file descriptors.
2011-04-22 09:34:03 +03:00
Uoti Urpala c2067cabaf audio: fill small AO buffers more often in audio-only case
Commit cbeed30ae8 ("core: wake up a bit less often for audio-only
files") increased the sleep time between audio buffer fills. This
turned out to cause problems on some machines where available audio
buffer sizes are extremely limited (example cases included 85 ms for
stereo and less for multichannel audio). Change the code to check
the amount of buffered audio and shorten sleep times accordingly if
needed.

Such short buffers violate some assumptions made by video timing code,
so they may still cause visible problems in some cases. At least on
some machines using ALSA the problem seems to be caused by bad
configuration defaults (small buffer memory limit which can be
increased).
2011-04-22 09:34:02 +03:00
Uoti Urpala d33877acb6 configure: abort if certain libraries can't be found
Change the behavior of the iconv, freetype, fontconfig and libass
tests when autodetection fails. They now abort instead of silently
creating a crippled build. Users who really want to build without
those features can use explicit --disable flags.
2011-04-20 21:53:56 +03:00