summaryrefslogtreecommitdiffstats
path: root/libaf
Commit message (Collapse)AuthorAgeFilesLines
* af: fix crash when trying to use volume controls with AC3 pass-throughwm42012-03-091-1/+8
| | | | | | | | | | | | | | | 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.
* af: print audio filter chain in verbose modewm42012-03-091-0/+35
| | | | The string format used in print_fmt() is taken from init_audio_filters().
* build: switch to libavutil bswap.h and intreadwrite.hUoti Urpala2012-02-011-2/+3
| | | | | | | | | | | | Remove the private bswap and intreadwrite.h implementations and use libavutil headers instead. Originally these headers weren't publicly installed by libavutil at all. That already changed in 2010, but the pure C bswap version in installed headers was very inefficient. That was recently (2011-12) improved and now using the public bswap version probably shouldn't cause noticeable performance problems, at least if using a new enough compiler.
* Update Libav API usesUoti Urpala2012-02-011-12/+9
| | | | | | | | | | | | | | | | | | | Change various code to use the latest Libav API. The libavcodec error_recognition setting has been removed and replaced with different semantics. I removed the "--lavdopts=er=<value>" option accordingly, as I don't think it's widely enough used to be worth attempting to emulate the old option semantics using the new API. A new option with the new semantics can be added later if needed. Libav dropped APIs that were necessary with all Libav versions until quite recently (like setting avctx->age), and it would thus not be possible to keep compatibility with previous Libav versions without adding workarounds. The new APIs also had some bugs/limitations in the recent Libav release 0.8, and it would not work fully (at least some avcodec options would not be set correctly). Because of those issues, this commit makes no attempt to maintain compatibility with anything but the latest Libav git head. Hopefully the required fixes and improvements will be included in a following Libav point release.
* af_volume: do not change data when volume is 1wm42012-01-161-5/+4
| | | | | | | | | | | When the volume multiplier is 1, the data shouldn't be changed, but the code actually multiplied each sample with 255/256. Change the factor to 256, and hope there wasn't a good reason for the value 255. Additionally, don't work on the data if it wouldn't be changed anyway. This is a micro-optimization. This doesn't touch the code path for the float format.
* configure, build: remove --disable-libav supportUoti Urpala2011-12-111-7/+1
| | | | | Remove support for building the player without libavcodec and libavformat. These libraries are now always required.
* cleanup: do libav* initialization on startupUoti Urpala2011-07-181-3/+0
| | | | | | | Do the global initialization of libavcodec and libavformat (avcodec_register_all(), av_register_all()) immediately on program startup and remove the initialization calls from various individual modules that use libavcodec/libavformat functionality.
* cleanup: silence most of the clang warningsClément Bœsch2011-07-091-1/+1
|
* audio: clamp sample values in float->int format conversionsRudolf Polzer2011-05-041-4/+4
| | | | | | | | | 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.
* cleanup: avoid various GCC warningsClément Bœsch2011-04-202-13/+14
|
* af_lavcac3enc: fix channel reorderingUoti Urpala2011-03-311-2/+3
| | | | | | Reordering to libavcodec channel order was broken with libavcodec versions using float input to the ac3 encoder because the reordering code still assumed int16 sample size. Fix.
* fix compilation with old FFmpeg versionsUoti Urpala2011-02-081-4/+5
| | | | | | | | | | | | af_lavcac3enc: use old SampleFormat names without AV_ prefix, the latter were only added in 2010-11 vd_ffmpeg: add ifdef around CODEC_ID_LAGARITH use demux_real: use ffmpeg_files/intreadwrite.h stream/http.c, stream/realrtsp/real.c: define AV_BASE64_SIZE macro for old libavutil versions lacking it
* af_lavcac3enc: fix for lavc AC-3 encoder change to float inputUoti Urpala2011-02-031-5/+26
| | | | | | | | | | | | | | | | The libavcodec AC-3 encoder was changed to use floats, and take floating point samples as input (the fixed-point version is still available under the new name "ac3_fixed"). This broke af_lavcac3enc because it blindly assumed without checking that the "ac3" encoder would take signed 16-bit integer samples. Improve af_lavcac3enc so that it checks the sample formats supported by the encoder and can handle either int16_t or float. Perhaps an option to keep using integer input but instead switch the encoder name to "ac3_fixed" for new libavcodec versions would have some value. Then again, maybe not. Using the preferred data format of the default "ac3" encoder should normally be best, so probably better not add such an option unless real need appears.
* cleanup: remove NULL checks before free() all over the codecboesch2010-11-1420-119/+51
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
* libaf: Make af_reinit "public", to allow using it in future patchesreimar2010-11-022-4/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32504 b3059339-0415-0410-9bf9-f77b7e298cf2
* audio: auto-add downmix filter when stereo output is requestedcigaes2010-11-021-0/+25
| | | | | | | | | | 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
* libaf: add opts pointer to struct af_streamUoti Urpala2010-11-021-0/+2
|
* af.c: Minor simplification of af_initreimar2010-11-021-5/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32347 b3059339-0415-0410-9bf9-f77b7e298cf2
* af.c: add "const" to af_append(), af_prepend() prototypesreimar2010-11-021-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32346 b3059339-0415-0410-9bf9-f77b7e298cf2
* build: enable/disable all FFmpeg libraries togetherUoti Urpala2010-11-021-3/+3
| | | | | | | | | 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
* Add central init_avcodec() to avoid duplicated libavcodec init codediego2010-11-021-7/+2
| | | | | | | | | | | | | | | | Patch by Vlad Seryakov, vseryakov gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32043 b3059339-0415-0410-9bf9-f77b7e298cf2 Refactor more instances of avcodec_initialized handling into init_avcodec(). This is a leftover from the previous commit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32044 b3059339-0415-0410-9bf9-f77b7e298cf2 Add missing #include for vd_ffmpeg.h; fixes the warning: libmpcodecs/vf_zrmjpeg.c:472: warning: implicit declaration of function 'init_avcodec' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32176 b3059339-0415-0410-9bf9-f77b7e298cf2
* af_lavcresample: avoid multiple calls to av_resample_initreimar2010-11-021-2/+18
| | | | | | | | | | | | | Avoid calling av_resample_init again when the values are the same as before. The init function can be called multiple times when e.g. additional format filters are inserted, so this speeds things up. Patch by Dan Oscarsson [Dan.Oscarsson tieto com]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31698 b3059339-0415-0410-9bf9-f77b7e298cf2 Reindent. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31699 b3059339-0415-0410-9bf9-f77b7e298cf2
* af_export: Avoid void *-arithmentic warningsreimar2010-11-021-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31608 b3059339-0415-0410-9bf9-f77b7e298cf2
* af_ladspa: Fix multiple instances of a filter typereimar2010-11-021-3/+2
| | | | | | | | Ensure that activate is called on each filter instance, even if we have e.g. multiple mono filters handling a multichannel file. Fixes one of the bugs reported as bug #1685. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31558 b3059339-0415-0410-9bf9-f77b7e298cf2
* af_extrastereo: Improve filter descriptiondiego2010-11-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31544 b3059339-0415-0410-9bf9-f77b7e298cf2
* af_lavcac3enc: fix assert failure "s->expect_len <= s->pending_data_size"Uoti Urpala2010-10-141-11/+11
| | | | | | | The code handling input format negotiation incorrectly used the bps value of the suggested input format instead of the format it was going to actually use. As a result the player could abort with the above assertion failure. Fix.
* af_lavcac3enc: actually enable the filter by defaultUoti Urpala2010-05-261-3/+1
| | | | | The filter was changed earlier to allow building without FFmpeg internal symbols. Make it actually available by default.
* af_lavcac3enc: make the filter work without FFmpeg internalsUoti Urpala2010-05-141-5/+20
| | | | | | | The only FFmpeg internal symbols required were some constants. Define them in the file itself instead. Also add some checks and fixes to make the code more robust and fix a potential memory corruption problem.
* Merge svn changes up to r30967Uoti Urpala2010-04-261-1/+1
|\
| * Rename get_path.[ch] --> path.[ch].diego2010-03-201-1/+1
| | | | | | | | | | | | | | These files now contain different functions related to path handling. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30943 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cosmetics: Remove pointless empty lines at EOF.diego2010-02-206-13/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30675 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Delete things related to old translation systemUoti Urpala2010-03-104-4/+0
| | | | | | | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* | Merge svn changes up to r30663Uoti Urpala2010-03-101-42/+55
|\| | | | | | | | | | | | | Conflicts: gui/cfg.c libmpcodecs/vd_dmo.c mplayer.c
| * Move code that makes the filter chain match the desired output format intoreimar2010-02-191-42/+55
| | | | | | | | | | | | | | | | | | 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
* | Merge svn changes up to r30463Uoti Urpala2010-03-091-11/+0
|\| | | | | | | | | | | Note that r30455 is wrong, that commit does not in fact change the default behavior as claimed in the commit message. It only breaks "-af-adv force=0", which was already pretty much useless though.
| * Make the code match the documentation by making higher-quality but slowerreimar2010-01-301-11/+0
| | | | | | | | | | | | | | | | audio filtering the default. This mostly means lavcresample being the default instead of plain "resample". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30455 b3059339-0415-0410-9bf9-f77b7e298cf2
* | translations: tweak cases that relied on concatenating adjacent stringsUoti Urpala2010-03-071-15/+17
| | | | | | | | | | | | | | | | Tweak some code parts that used to rely on string literals from translation macros being concatenated with other adjacent string literals. Break up the resulting string into independently translated parts, so that the existing translations for those parts can still be used.
* | Restore collapsed whitespace in output messagesUoti Urpala2010-03-071-1/+1
| | | | | | | | | | | | | | | | | | For some reason commit e306174952d42e1cd6cc5efc50ae6bb0410501bc, which replaced translation macro names with the corresponding English strings, also collapsed multiple consecutive space characters into one. Change most of these back. In a couple of cases the amount of whitespace is important for alignment, and for the rest it at least keeps the strings closer to the existing translations.
* | Merge svn changes up to r30375Uoti Urpala2010-01-251-0/+1
|\|
| * Add a proper header for our strsep implementation so strsep willreimar2010-01-171-0/+1
| | | | | | | | | | | | | | 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
* | Merge svn changes up to r30301Uoti Urpala2010-01-254-26/+24
|\|
| * Let the format filter do the AC3 endianness conversion instead of duplicatingreimar2010-01-111-21/+7
| | | | | | | | | | | | | | the conversion code over and over. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30285 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add support for distinguishing between little- and big-endian SPDIF AC3reimar2010-01-114-5/+14
| | | | | | | | | | | | | | and converting between both. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30283 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add a hack to af_fmt2bits to recognize AC3 as a 16-bit format, since thisreimar2010-01-111-0/+1
| | | | | | | | | | | | | | is more correct than 8 bit for alignment purposes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30278 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add and use AF_FORMAT_IS_AC3 macro.reimar2010-01-111-0/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30276 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Revert r30170, AF_FORMAT_AC3 is supposed to be the special mask,reimar2010-01-111-1/+1
| | | | | | | | | | | | | | and should not include other parts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30275 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30173Uoti Urpala2010-01-081-1/+1
|\|
| * Mark AC3 as 16-bit format, this simplifies alignment calculation and fixesreimar2010-01-021-1/+1
| | | | | | | | | | | | | | hwac3 with ALSA reportedly broken by r29750. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30170 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29971Uoti Urpala2009-11-291-11/+11
|\|
| * Fix mangling of 24-bit audio during channel reorder.tack2009-11-281-11/+11
| | | | | | | | | | | | | | | | | | | | | | Only 1/3 of the samples in the buffer passed to reorder_channel_nch() were being reordered. For 8-, 16-, and 32-bit audio, the buffers could be treated as int8_t, int16_t, and int32_t respectively. 24-bit audio was being processed as int8_t, requiring iteration over n_samples*3, not n_samples. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29971 b3059339-0415-0410-9bf9-f77b7e298cf2
* | af_scaletempo: Fix delay value after changing scale to 1Uoti Urpala2009-11-221-0/+1
| | | | | | | | | | | | | | | | | | | | The scaletempo filter has a special-case check to return the samples unchanged if the current scaling factor is 1. In this case code setting af->delay wasn't run. If the scale had had a different value and then been changed to 1 as a result of a playback speed change then the delay field could have a nonzero value left, resulting in A/V sync errors. Fix by setting the delay field to 0 in the scale == 1 special case code.
* | Merge svn changes up to r29912Uoti Urpala2009-11-164-19/+196
|\|
| * Add support for 8 channel audio.tack2009-11-104-13/+195
| | | | | | | | | | | | | | | | Where 8 channel support is non-trivial (e.g. ao_dsound), at least ensure we fail gracefully. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29868 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Cosmetics: remove trailing whitespace from file.tack2009-11-101-1/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29867 b3059339-0415-0410-9bf9-f77b7e298cf2
| * reorder_ch: Remove unneeded AF_CHANNEL_LAYOUT_LAVC_AAC_DEC_*tack2009-11-042-6/+1
| | | | | | | | | | | | | | All references to these values were removed r29821. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29822 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29752Uoti Urpala2009-10-061-12/+12
|\| | | | | | | | | | | | | | | | | As part of merging subtitle-in-terminal changes make update_subtitles() only clear existing subtitles if called with the reset argument, and not try to set new ones. Later calls should set the needed new subtitles, and this change avoids some problems with trying to set subtitles when mp_property_sub() in command.c gets called from initialization code before full initialization.
| * Change libaf control ordering to make the controls unique again, ↵reimar2009-09-261-12/+12
| | | | | | | | | | | | | | | | | | (AF_CONTROL_PAN_BALANCE vs. AF_CONTROL_PLAYBACK_SPEED), put them in-order again and add a bit of padding in-between. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29718 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29544Uoti Urpala2009-08-223-29/+30
|\|
| * Fix channel reordering when using 24-bit samples by adding breaks to casestack2009-08-191-0/+4
| | | | | | | | | | | | | | | | | | missed by r29427. Patch submitted by Shane W, shane-mplayer csy ca git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29541 b3059339-0415-0410-