1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-21 22:30:22 +00:00
mpv/demux
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
..
codec_tags.c demux: add "BIKb" FourCC 2014-04-08 22:59:53 +02:00
codec_tags.h
demux_cue.c Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
demux_disc.c demux_disc: handle new_sh_stream() fail correctly 2014-08-30 15:15:37 +02:00
demux_edl.c
demux_lavf.c demux: gracefully handle packet allocation failures 2014-09-16 18:11:00 +02:00
demux_libass.c demux_libass: change how external ASS subtitles are loaded 2014-03-15 22:17:51 +01:00
demux_mf.c demux: gracefully handle packet allocation failures 2014-09-16 18:11:00 +02:00
demux_mkv.c demux: gracefully handle packet allocation failures 2014-09-16 18:11:00 +02:00
demux_playlist.c build: include <strings.h> for strcasecmp() 2014-07-10 08:29:32 +02:00
demux_raw.c audio: cleanup spdif format definitions 2014-09-23 23:11:54 +02:00
demux_subreader.c demux: fix timestamp type for seek calls 2014-07-21 19:29:58 +02:00
demux_tv.c audio: drop swapped-endian audio formats 2014-09-23 23:09:25 +02:00
demux.c demux: allow increasing filepos only 2014-09-03 02:00:18 +02:00
demux.h demux: get rid of old wrapper 2014-09-01 22:12:39 +02:00
ebml.c ebml: warn if there are too many subelements 2014-09-04 19:21:19 +02:00
ebml.h Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
matroska.h demux_mkv: add S_DVBSUB 2014-06-17 22:44:27 +02:00
mf.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
mf.h
ms_hdr.h Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
packet.c demux: gracefully handle packet allocation failures 2014-09-16 18:11:00 +02:00
packet.h demux: always use AVPacket 2014-08-25 00:46:26 +02:00
stheader.h audio: drop swapped-endian audio formats 2014-09-23 23:09:25 +02:00