mpv/audio
wm4 81bf9a1963 audio: cleanup spdif format definitions
Before this commit, there was AF_FORMAT_AC3 (the original spdif format,
used for AC3 and DTS core), and AF_FORMAT_IEC61937 (used for AC3, DTS
and DTS-HD), which was handled as some sort of superset for
AF_FORMAT_AC3. There also was AF_FORMAT_MPEG2, which used
IEC61937-framing, but still was handled as something "separate".

Technically, all of them are pretty similar, but may use different
bitrates. Since digital passthrough pretends to be PCM (just with
special headers that wrap digital packets), this is easily detectable by
the higher samplerate or higher number of channels, so I don't know why
you'd need a separate "class" of sample formats (AF_FORMAT_AC3 vs.
AF_FORMAT_IEC61937) to distinguish them. Actually, this whole thing is
just a mess.

Simplify this by handling all these formats the same way.
AF_FORMAT_IS_IEC61937() now returns 1 for all spdif formats (even MP3).
All AOs just accept all spdif formats now - whether that works or not is
not really clear (seems inconsistent due to earlier attempts to make
DTS-HD work). But on the other hand, enabling spdif requires manual user
interaction, so it doesn't matter much if initialization fails in
slightly less graceful ways if it can't work at all.

At a later point, we will support passthrough with ao_pulse. It seems
the PulseAudio API wants to know the codec type (or maybe not - feeding
it DTS while telling it it's AC3 works), add separate formats for each
codecs. While this reminds of the earlier chaos, it's stricter, and most
code just uses AF_FORMAT_IS_IEC61937().

Also, modify AF_FORMAT_TYPE_MASK (renamed from AF_FORMAT_POINT_MASK) to
include special formats, so that it always describes the fundamental
sample format type. This also ensures valid AF formats are never 0 (this
was probably broken in one of the earlier commits from today).
2014-09-23 23:11:54 +02:00
..
decode audio: cleanup spdif format definitions 2014-09-23 23:11:54 +02:00
filter audio: cleanup spdif format definitions 2014-09-23 23:11:54 +02:00
out audio: cleanup spdif format definitions 2014-09-23 23:11:54 +02:00
audio.c af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriate 2014-05-28 21:38:00 +02:00
audio.h af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriate 2014-05-28 21:38:00 +02:00
audio_buffer.c Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
audio_buffer.h audio: add mp_audio_buffer 2013-11-12 23:28:21 +01:00
chmap.c Add more const 2014-06-11 00:39:14 +02:00
chmap.h Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
chmap_sel.c Add more const 2014-06-11 00:39:14 +02:00
chmap_sel.h audio: add channel map selection function 2013-05-12 21:24:57 +02:00
fmt-conversion.c audio: fix format ID conversion 2013-12-23 21:24:41 +01:00
fmt-conversion.h ad_lavc: use fmt-conversion to map sample formats 2013-04-13 04:21:27 +02:00
format.c audio: cleanup spdif format definitions 2014-09-23 23:11:54 +02:00
format.h audio: cleanup spdif format definitions 2014-09-23 23:11:54 +02:00
mixer.c mixer: always restore volume (even with pulse), don't unmute 2014-09-20 02:02:29 +02:00
mixer.h player: show "neutral" position markers for OSD bars 2014-06-08 23:52:58 +02:00