1
mirror of https://github.com/mpv-player/mpv synced 2024-09-09 01:16:56 +02:00
mpv/audio
wm4 e60b8f181d audio/filter: split af_format into separate filters, rename af_force
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.
2013-10-23 10:04:12 +02:00
..
decode ad_mpeg123: support in-stream format changes 2013-10-06 23:41:18 +02:00
filter audio/filter: split af_format into separate filters, rename af_force 2013-10-23 10:04:12 +02:00
out ao_pcm: big endian AC3 in wav doesn't work 2013-10-22 01:01:07 +02:00
audio.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
audio.h audio/filters: add af_force 2013-05-12 21:24:56 +02:00
chmap_sel.c ao_jack: allow more control about channel layouts 2013-07-07 18:37:55 +02:00
chmap_sel.h audio: add channel map selection function 2013-05-12 21:24:57 +02:00
chmap.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
chmap.h core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
fmt-conversion.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
fmt-conversion.h ad_lavc: use fmt-conversion to map sample formats 2013-04-13 04:21:27 +02:00
format.c audio/format: add some helper functions 2013-10-22 01:01:41 +02:00
format.h audio/format: add some helper functions 2013-10-22 01:01:41 +02:00
mixer.c command: don't allow changing volume if no audio initialized 2013-10-12 18:57:02 +02:00
mixer.h command: don't allow changing volume if no audio initialized 2013-10-12 18:57:02 +02:00
reorder_ch.c audio: fix compilation with older libavresample versions 2013-05-13 00:39:07 +02:00
reorder_ch.h audio: fix compilation with older libavresample versions 2013-05-13 00:39:07 +02:00