aboutsummaryrefslogtreecommitdiffhomepage
path: root/audio/filter
Commit message (Collapse)AuthorAge
...
* af: remove a pointless macroGravatar wm42013-11-07
| | | | | The code should be equivalent; a compatibility macro definition is left. (It should be mass-replaced later.)
* audio: replace af_fmt2str_short -> af_fmt_to_strGravatar wm42013-11-07
| | | | Also, remove all af_fmt2str usages.
* configure: uniform the defines to #define HAVE_xxx (0|1)Gravatar Stefano Pigozzi2013-11-03
| | | | | | | | | | | | | | | | | | | | | The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
* af: replace macros with too generic namesGravatar wm42013-10-26
| | | | | | | | Defining names like min, max etc. in an often used header is not really a good idea. Somewhat similar to MPlayer svn commit 36491, but don't use libavutil, because that typically causes us sorrow.
* af_volume: some more cosmeticsGravatar wm42013-10-26
|
* af_volume: switch to new option parsingGravatar wm42013-10-26
|
* af_volume: uncrustifyGravatar wm42013-10-26
| | | | Also, use more C99 and remove "register" keywords.
* af_volume: don't change volume if nothing is to be changedGravatar wm42013-10-26
| | | | | On the float path. Note that this skips clipping, but we expect that everything on the audio-path is pre-clipped anyway.
* af_volume: remove unused featuresGravatar wm42013-10-26
| | | | | | Roughly follows MPlayer svn commits 36492 and 36493. We also remove the volume peak reporting. (There are much better libavfilter filters for this, I think.)
* audio/filter: remove useless af_info fieldsGravatar wm42013-10-23
| | | | | | | Drop the author and comment fields. They were completely unused - not even printed in verbose mode, just dead weight. Also use designated initializers and drop redundant flags.
* af_force: set format early for better debug outputGravatar wm42013-10-23
| | | | | | | Set the input/output format in filter init. This doesn't change anything functionally, but it makes the forced format show up in the filter chain init verbose output (which sometimes prints the filter chain before all filters have been configured).
* af_force: minor simplificationsGravatar wm42013-10-23
|
* audio/filter: rename af_force.c to af_format.cGravatar wm42013-10-23
| | | | The filter itself was already renamed earlier - but rename the file too.
* audio/filter: split af_format into separate filters, rename af_forceGravatar wm42013-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | af_format is the old audio conversion filter. It could do all possible conversions supported by the audio chain. However, ever since the addition of af_lavrresample, most conversions are done by libav/swresample, and af_format is used as fallback. Separate out the fallback cases and remove af_format. af_convert24 does 24 bit <-> 32 bit conversions, while af_convertsignendian does sign and endian conversions. Maybe the way the conversions are split sounds a bit odd. But the former changes the size of the audio data, while the latter is fully in-place, so there's at least different buffer management. This requires a quite complicated algorithm to make sure all these "partial" conversion filters can actually get from one format to another. E.g. s24le->s32be always requires convertsignendian and convert24, but af.c has no idea what the intermediate format should be. So I added a graph search (trying every possible format and filter) to determine required format and filter. When I wrote this, it seemed this was still better than messing everything into af_lavrresample, but maybe this is overkill and I'll change my opinion. For now, it seems nice to get rid of af_format though. The AC3->IEC61937 conversion isn't supported anymore, but I don't think this is needed anywhere. Most AOs test all formats explicitly, or use the AF_FORMAT_IS_IEC61937() macro (which includes AC3). One positive consequence of this change is that conversions always include dithering (done by libav/swresample), instead of possibly going through af_format, which doesn't do anything fancy. Rename af_force to af_format. It's essentially compatible with command line uses of af_format. We retain a compatibility alias for af_force.
* af_lavrresample: actually free resamplerGravatar wm42013-10-19
| | | | Fixes #304.
* af: merge af_reinit() and fix_output_format()Gravatar wm42013-09-20
| | | | | | | | | | | | | | | | Calling them separately doesn't really make sense, and all existing calls to them usually combined them. One subtitle difference was that af_init() didn't wipe the filter chain if initialization of the chain itself failed, but that didn't really make sense anyway. Also remove af_init() from the code for setting balance in mixer.c. The mixer should be in the initialized state only if audio is fully initialized, so the af_init() call made no sense. Note that the filter "editing" code in command.c doesn't really do a nice job of handling errors in case recreating an _old_ (known to work) filter chain unexpectedly fails, and this obscure/rare case might be differently handled after this change.
* mixer, af_volume: use linear values instead of dBGravatar wm42013-09-19
| | | | | | | Softvol always used a linear multiplier for volume control. This was converted to dB, and then back to linear in af_volume. Remove this non- sense. We still try to keep the command line argument to af_volume in dB, though.
* af_export: fix compilation warningGravatar wm42013-09-19
| | | | Blargh.
* Config path functions can return NULLGravatar wm42013-09-18
| | | | | | | It's quite unlikely, but functions like mp_find_user_config_file() can return NULL, e.g. if $HOME is unset. Fix all the code that didn't check for this correctly yet.
* audio: make internal audio format 0 an invalid formatGravatar wm42013-08-26
| | | | | | | | | | | | Having to use -1 for that is generally quite annoying. Audio formats are created from bitmasks, and it can't be excluded that 0 is not a valid format. Fix this by adjusting AF_FORMAT_I so that it is never 0. Along with AF_FORMAT_F and the special formats, all valid formats are covered and guaranteed to be non-0. It's possible that this commit will cause some regressions, as the check for invalid audio formats changes a bit.
* core: move contents to mpvcore (2/2)Gravatar Stefano Pigozzi2013-08-06
| | | | Followup commit. Fixes all the files references.
* core: change speed option/property to doubleGravatar wm42013-08-05
| | | | | | | | | | | | | The --speed option and the speed property used float. Change them to double. Change the commands that manipulate the property (speed_mult/add) to double as well. Since the cycle command shares code with the add command, we change that as well. The reason for this change is that this allows better control over speed, such as stepping by semitones. Using floats is also just plain unnecessary.
* Fix some -Wshadow warningsGravatar wm42013-07-23
| | | | | | In general, this warning can hint to actual bugs. We don't enable it yet, because it would conflict with some unmerged code, and we should check with clang too (this commit was done by testing with gcc).
* options: make legacy hacks for AFs/VFs more explicitGravatar wm42013-07-22
| | | | | This means that AOs/VOs with no options set do not take the legacy option parsing path, but instead report that they have no options.
* af_bs2b: use new option APIGravatar wm42013-07-22
|
* af_lavfi: switch to new option APIGravatar wm42013-07-22
| | | | | This makes it actually possible to use the filter with more complicated filter graphs (such as graphs containing the "," character).
* af_scaletempo: use new option APIGravatar wm42013-07-22
|
* af_lavrresample: switch to new option APIGravatar wm42013-07-22
| | | | | Also add a "o" suboption, which should allow fine control over libavresample.
* af_force: use new option APIGravatar wm42013-07-22
|
* audio/filter: use new option APIGravatar wm42013-07-22
| | | | | | | | | | | | | Make the VF/VO/AO option parser available to audio filters. No audio filter uses this yet, but it's still a quite intrusive change. In particular, the commands for manipulating filters at runtime completely change. We delete the old code, and use the same infrastructure as for video filters. (This forces complete reinitialization of the filter chain, which hopefully isn't a problem for any use cases. The old code forced reinitialization too, but it could potentially allow a filter to cache things; e.g. consider loaded ladspa plugins and such.)
* af_force: add option that causes filter to fail at initializationGravatar wm42013-07-22
| | | | This is useful for debugging.
* af: fix recovery code for filter insertion (changing volume with spdif crash)Gravatar wm42013-07-22
| | | | | | | | | | | | This code is supposed to run if dynamic filter insertion (such as when inserting a volume filter in mixer.c) fails. Then it removes all filters and recreates the default list of filters. But the code just blew up and entered an endless loop, because it removed even the sentinel in/out filters. This could happen when trying to use softvol controls while using spdif, but also other situations. Fix it by calling the correct code. Also remove these obnoxious yoda-conditions.
* af_lavfi: add libavfilter bridgeGravatar wm42013-05-23
| | | | | | | | | | | | | | | | | | | | | Mostly copied from vf_lavfi. The parts that could be shared are minor, because most code is about setting up audio and video, which are too different. This won't work with Libav. I used ffplay.c as guide, and noticed too late that their setup methods are incompatible with Libav's. Trying to make it work with both would be too much effort. The configure test for av_opt_set_int_list() should disable af_lavfi gracefully when compiling with Libav. Due to option parser chaos, you currently can't have a "," as part of the filter graph string - not even with quoting or escaping. This will probably be fixed later. The audio filter chain is not PTS aware. So we have to do some hacks to make up a fake PTS, and we have to map the output PTS back to the filter chain's method of tracking PTS changes and buffering, by adjusting af->delay.
* af_lavrresample: fix inverted conditionGravatar wm42013-05-13
| | | | | This was added with the previous commit. It likely broke some obscure special-cases, which (hopefully) do not happen with normal playback.
* audio: fix compilation with older libavresample versionsGravatar wm42013-05-13
| | | | | | | | | | | | | | The libavresample version of the current Libav stable release lacks the avresample_set_channel_mapping() function. (FFmpeg's libswresample seems to be fine, because they added swr_set_channel_mapping() first.) Add a cheap/slow workaround to do channel reordering on our own. We don't use the recently removed MPlayer code (see commit 586b75a), because that is not generic enough. The functionality should be the same as with full-featured libavresample, and any differences are bugs. It's probably slower, though.
* af: improve filter chain setup retry limitGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | af_reinit() is responsible for inserting automatic conversion filters for channel remixing, format conversion, and resampling. We don't require that a single filter can do all these (even though af_lavrresample does nearly all of this, sometimes af_format has to be used instead for format conversions). This makes setting up the chain more complicated, and a way is needed to prevent endless appending of conversion filters if a conversion is not possible. Until now, this used a stupidly simple yet robust static retry limit to detect failure. This is perfectly fine, and the limit (20) was good enough to handle about ~5 filters. But with more filters, and if each filter requires 3 additional conversion filters, this would fail. So raise the limit to 4 retries per filter. This is still stupidly simple and robust, but won't arbitrarily fail if the filter count is too large.
* af_lavrresample: avoid channel reordering with unknown layoutsGravatar wm42013-05-12
| | | | | | | If one of the input or output is an unknown layout, but the other is known, it can still happen that channels are remixed randomly. Avoid this by forcing default layouts in this case. (Doesn't work if the channel counts are different.)
* audio/filters: add af_forceGravatar wm42013-05-12
| | | | | Its main purpose is for testing in case channel layout stuff breaks, in particular in connection with old audio filters.
* af_ladspa: code cleanupGravatar eng2013-05-12
| | | | | | Cleanup based on results from cppcheck-1.59 Reduce the scope of several variables Fix memory leak
* audio: print channel map additionally to channel count on terminalGravatar wm42013-05-12
|
* af: print filter chain info on errorGravatar wm42013-05-12
| | | | | The filter chain was only visible with -v. Always print it if the filter chain could not be configured.
* reorder_ch: remove old channel reorder functionsGravatar wm42013-05-12
| | | | | | | This is done in af_lavrresample now, and as part of format negotiation. Also remove the remaining reorder_channel calls. They were redundant and did nothing.
* audio: let libavresample do channel reorderingGravatar wm42013-05-12
|
* af_lavrresample: context is always allocated hereGravatar wm42013-05-12
|
* af_pan: set unknown channel layout for outputGravatar wm42013-05-12
|
* af: use mp_chmap for mp_audio, include channel map in format negotiationGravatar wm42013-05-12
| | | | | Now af_lavrresample pretends to reorder the channels, although it doesn't yet, and nothing sets non-standard layouts either.
* audio: add some setters for mp_audio, and require filters to use themGravatar wm42013-05-12
| | | | | | | | | | | | | | | | mp_audio has some redundant fields. Setters like mp_audio_set_format() initialize these properly. Also move the mp_audio struct to a the file audio.c. We can remove a mysterious line of code from af.c: in.format |= af_bits2fmt(in.bps * 8); I'm not sure if this was ever actually needed, or if it was some kind of "make it work" quick-fix that works against the way things were supposed to work. All filters etc. now set the format correctly, so if there ever was a need for this code, it's definitely gone.
* audio: add channel map APIGravatar wm42013-05-12
| | | | | | | Unused, will be used in the following commits. Let chmap.h define the number of maximum channels, because that is most convenient.
* audio/filter: remove unused AF_CONTROLsGravatar wm42013-05-12
| | | | Was unused, has never been used.
* af: fix negotiation endless loopGravatar wm42013-04-13
| | | | | | | Yeah... ok. Can be reproduced by having AF_CONTROL_CHANNELS not really set the correct channel map.