summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_lavrresample.c
Commit message (Collapse)AuthorAgeFilesLines
* af_lavrresample: actually free resamplerwm42013-10-201-0/+3
| | | | Fixes #304.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-3/+3
| | | | Followup commit. Fixes all the files references.
* af_lavrresample: switch to new option APIwm42013-07-221-51/+45
| | | | | Also add a "o" suboption, which should allow fine control over libavresample.
* af_lavrresample: fix inverted conditionwm42013-05-131-1/+1
| | | | | 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 versionswm42013-05-131-0/+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_lavrresample: avoid channel reordering with unknown layoutswm42013-05-121-8/+24
| | | | | | | 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: let libavresample do channel reorderingwm42013-05-121-3/+49
|
* af_lavrresample: context is always allocated herewm42013-05-121-2/+1
|
* af: use mp_chmap for mp_audio, include channel map in format negotiationwm42013-05-121-19/+14
| | | | | 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 themwm42013-05-121-10/+6
| | | | | | | | | | | | | | | | 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.
* af_lavrresample: add no-detach suboptionwm42013-04-131-1/+6
| | | | | Normally, af_lavrresample detaches itself immediately if the input and output audio parameters are the same. no-detach prevents this.
* audio: switch to libavcodec channel order, use libavresample for mixingwm42013-04-131-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the internal channel order to libavcodec's. If the channel number mismatches at some point, use libavresample for up- or downmixing. Remove the old af_pan automatic downmixing. The libavcodec channel order should be equivalent to WAVEFORMATEX order, at least nowadays. reorder_ch.h assumes that WAVEFORMATEX and libavcodec might be different, but all defined channels have the same mappings. Remove the downmixing with af_pan as well as the channel conversion with af_channels from af.c, and prefer af_lavrresample for this. The automatic downmixing behavior should be the same as before (if the --channels option is set to 2, which is the default, the audio output is forced to 2 channels, and libavresample does all downmixing). Note that mpv still can't do channel layouts. It will pick the default channel layout according to the channel count. This will be fixed later by passing down the channel layout as well. af_hrtf depends on the order of the input channels, so reorder to ALSA (for which this code was written). This is better than changing the filter code, which is more risky. ao_pulse can accept waveext order directly, so set that as channel mapping.
* af: use af_lavrresample for format conversions, if possiblewm42013-04-131-1/+8
| | | | | | | | | | | | | Refactor to remove the duplicated format filter insertion code. Allow other format converting filters to be inserted on format mismatches. af_info.test_conversion checks whether conversion between two formats would work with the given filter; do this to avoid having to insert multiple conversion filters at once and such things. (Although this isn't ideal: what if we want to avoid af_format for some conversions? What if we want to split af_format in endian-swapping filters etc.?) Prefer af_lavrresample for conversions that it supports natively, otherwise let af_format handle the full conversion.
* af_lavrresample: allow other ffmpeg sample formats for input/outputwm42013-04-131-17/+48
| | | | | | | The format was locked to s16. Extend it to accept all other ffmpeg sample formats, and even allow different in- and output formats. The generic filter code will still insert af_format on format mismatches, though.
* af_lavrresample: add new resampling filter to replace the old onesStefano Pigozzi2013-03-131-0/+277
Remove `af_resample` and `af_lavcresample`. The former is a mess while the latter uses an API that was long deprecated in libavcodec and is now removed. `af_lavrresample` rougly has the same features and structure of `af_lavcresample`. libswresample fallback by wm4.