Commit Graph

96 Commits

Author SHA1 Message Date
wm4 7187b49148 af: fix crash when trying to use volume controls with AC3 pass-through
Changing the volume when softvol is enabled or if the audio output driver
doesn't support volume controls causes insertion of the "volume" filter.
This fails with AC3. Since the filter wasn't removed after that, and the
filter chain was in a bogus state, random crashes occured past this
point.

Fix it by reinitializing the filter chain completely on failure. Volume
controls simply won't work. (This can't be fixed, because AC3 is a
compressed format, and would require additional decoding/encoding passes
in order to support arbitrary volume changes.)

This also affects balance controls.
2012-01-18 04:21:46 +01:00
wm4 7eac60417f af: print audio filter chain in verbose mode
The string format used in print_fmt() is taken from init_audio_filters().
2012-01-18 04:21:45 +01:00
Uoti Urpala 2e1cdcb9e6 configure, build: remove --disable-libav support
Remove support for building the player without libavcodec and
libavformat. These libraries are now always required.
2011-12-11 07:48:26 +02:00
cboesch fe3c4810e1 cleanup: remove NULL checks before free() all over the code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-14 13:11:20 +02:00
reimar 3452e2e907 libaf: Make af_reinit "public", to allow using it in future patches
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32504 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:37 +02:00
cigaes 579d743159 audio: auto-add downmix filter when stereo output is requested
When -channels 2 [default] is specified and the audio decoder used
does not support internal downmixing, automatically add a pan filter
after the decoder to downmix to stereo.

Patch by Clément Bœsch, ubitux gmail com

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32356 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:07 +02:00
reimar 7dd0d8f6df af.c: Minor simplification of af_init
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32347 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:07 +02:00
reimar 8d466ff705 af.c: add "const" to af_append(), af_prepend() prototypes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32346 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:07 +02:00
Uoti Urpala c5e462b33d build: enable/disable all FFmpeg libraries together
Enable all of libavcodec, libavformat, libswscale, and libpostproc
together (libavutil is always required).

based on svn commit by diego:

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32226 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:55 +02:00
Uoti Urpala ba5f104836 af_lavcac3enc: actually enable the filter by default
The filter was changed earlier to allow building without FFmpeg
internal symbols. Make it actually available by default.
2010-05-26 11:15:54 +03:00
Uoti Urpala 13221a7165 Merge svn changes up to r30663
Conflicts:
	gui/cfg.c
	libmpcodecs/vd_dmo.c
	mplayer.c
2010-03-10 00:13:11 +02:00
reimar dd79cbf17b Move code that makes the filter chain match the desired output format into
a separate function.
Call this function also from af_add, fixes audio corruption with e.g.
-softvol -af format=s16be (bug #1561).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30659 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-19 21:52:29 +00:00
Uoti Urpala 4ebf007580 Merge svn changes up to r30375 2010-01-25 15:36:38 +02:00
reimar 1a5841fbbb Add a proper header for our strsep implementation so strsep will
not be used without a declaration, causing issues on 64 bit systems.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30355 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-17 15:08:31 +00:00
Uoti Urpala a92a43b91f build: Readd support for code depending on FFmpeg internals
Add configure option --ffmpeg-source-dir=PATH. If the user specifies
this option then building code that depends on FFmpeg internals is
enabled and the files files which use internal lavf headers will get
them from this path. The FFmpeg libraries linked with must export
needed internal symbols.
2009-07-26 20:22:48 +03:00
Uoti Urpala 0eb321bf2c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
diego 6e9cbdc104 whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-13 02:58:57 +00:00
bircoph e3b6f71b2d Add libbs2b audio filter itself.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29132 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-04-02 19:01:57 +00:00
diego 2e903f7c75 Remove unnecessary malloc.h #includes and related #ifdeffery.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29126 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-04-02 09:20:48 +00:00
bircoph 42a792bbc7 Remove af_msg special-casing API in libaf.
Replace it by standard mp_msg message system.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29088 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-28 19:57:56 +00:00
diego db757ae96b Add missing #include "config.h", fixes the warning:
libaf/af.c:23:5: warning: "HAVE_MALLOC_H" is not defined


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28697 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-02-21 21:29:38 +00:00
diego 0cddea3754 Add statistics audio filter that prints information about the audio stream.
patch by Nicolas George, nicolas.george normalesup org


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28696 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-02-21 21:27:27 +00:00
diego be8c67909b Convert HAVE_MALLOC_H into a 0/1 definition, fixes the warning:
mem.c:32:5: warning: "HAVE_MALLOC_H" is not defined


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28629 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-02-17 11:16:19 +00:00
diego 8198c5f15e Replace informal license notices by standard license header
and add standard license header where missing.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28264 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-01-05 12:41:40 +00:00
diego 141e81cce4 Rename a bunch of miscellaneous preprocessor directives.
Switch them from a HAVE_ to a CONFIG_ prefix.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27423 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-07 08:58:07 +00:00
diego 4b141479da Start unifying names of internal preprocessor directives.
Replace all USE_ prefixes by CONFIG_ prefixes to indicate
options which are configurable.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27373 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-07-30 12:01:30 +00:00
ulion 66abcc42af Add new audio filter for encoding multi-channel audio into ac3 at runtime.
And if set first parameter of this filter to 1, it will do ac3 passthrough
like hwac3 did.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25385 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-13 12:38:17 +00:00
ulion 0fe9266445 Fix my wrong code in r25530.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25334 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-10 11:08:27 +00:00
ulion 920a892892 Fix missing command line bug by making the input parameter constant.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25330 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-10 01:43:33 +00:00
ulion 70e7acda26 Prevent from using data->len when data is NULL (when play() return NULL).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25143 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-23 05:50:34 +00:00
uau d7f6cb23de A/V sync: take audio filter buffers into account
Substract the delay caused by filter buffering when calculating
currently playing audio position. This matters for af_scaletempo which
buffers significant and varying amounts of data. For other current
filters the effect is normally insignificant.

Instead of the old time-based filter delay field (which was ignored)
this version stores the per-filter delay in units of bytes input read
without corresponding output. This allows the current scaletempo
behavior where other filters before and after it can see the same
nominal samplerate even though the real duration of the data varies;
in this case the other filters can not know the delay they're causing
in terms of real time.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24928 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:50 +00:00
uau d33703496c Add audio filter scaletempo
Patch by Robert Juliano, juliano.1 osu edu


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24924 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:38 +00:00
uau 1844e1dd0c Change decode_audio() interface
Rewrite decode_audio to better deal with filters that handle input in
large blocks. It now always places output in sh_audio->a_out_buffer
(which was always given as a parameter before) and reallocates the
buffer if needed. After the changes filters can return arbitrarily
large blocks of data without some of it being lost. The new version
also allows simplifying some code.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24920 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:19 +00:00
uau 5bfedc0a2d Remove some pointless 'inline' qualifiers
Most of these functions aren't even used in the same translation unit.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24918 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:10 +00:00
uau ab2237c15a libaf: Remove rational number implementation
Remove the mul/cancel/gcd functions and some related code. Use ff_gcd
instead of the removed af_gcd in af_resample.c.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24917 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:06 +00:00
uau 7deec05ea0 libaf: change filter input/output ratio calculations
Change the audio filters to use a double instead of rationals for the
ratio of output to input size. The rationals could overflow when
calculating the overall ratio of a filter chain and gave no real
advantage compared to doubles.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24916 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:01 +00:00
uau c6824f577e Remove unused functions in af.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24915 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:51:57 +00:00
uau 0f6d5e4fd9 Change value used to indicate "unknown audio format" from 0 to -1.
0 collided with a valid format value.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20787 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-08 18:31:04 +00:00
uau 203d128918 Fix stupid use of multiplication to check signs which fails because of
overflow. Negative values do not seem to be used so just remove the 
failing test.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19889 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-09-18 14:04:50 +00:00
reynaldo ca1970b25a makes several libaf functions static coz they are not used outside their source files. Patch by Stefan Huehner, stefan AT huehner-org
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18972 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-07-09 03:59:52 +00:00
corey 9fb516e90a Rename sinesupress to sinesuppress, including af_sinesupress.c file rename.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18612 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-06-07 00:02:51 +00:00
reynaldo d6081d2977 New karaoke af
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18471 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-05-13 08:46:31 +00:00
reynaldo 3a406e94d7 Get ride of the several if(identify) messy lines and rearangment of some of the output, both patches by Kiriuja mplayer-patches AT en-directo_net, his changes are barely unrelated, nevertheless Im commiting them thogeter just for the sake of my mental healt, I had both patches already applied on my local three
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18238 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-04-24 07:20:34 +00:00
michael 9b2c81e1bb very simple filter which can remove a sine at a specified frequency, usefull to get rid of the 50/60hz noise on ultra crappy equipment
probably works only with 1 channel input


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18083 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-04-13 10:36:17 +00:00
reimar 694f18ea46 fix memory leak when filter with given name does not exist.
Also prints which filter failed in the malloc-failed case


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17781 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-08 15:39:53 +00:00
reimar d475a9523f semi-hack: avoid passing 0-length blocks to audio filters.
Fixes bugzilla bug #391 (lavcresample crashes).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16816 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-10-20 09:12:28 +00:00
reimar 01ced1e49e documentation-only patch: make doxygen compatible and create
af_chain and af_filter doxygen modules.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16628 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-10-01 12:55:34 +00:00
reimar 2066463ec5 Avoid hang with -af-adv force=3
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16073 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-07-23 16:58:25 +00:00
reimar d22ae4a4d9 make -srate work again, unify audio filter init and preinit.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15812 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-06-24 10:50:53 +00:00
diego 8475733dc2 Fix mp_msg vs af_msg usage as pointed out by Ivo.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15792 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-06-21 01:00:35 +00:00