diff options
author | wm4 <wm4@nowhere> | 2015-03-10 15:12:52 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-10 15:12:52 +0100 |
commit | 5f8b060ec2dde7d0ff5468a5b7499851c22b756d (patch) | |
tree | 593321dd494d3bf24727ec7ee3a7631b07b49cc8 /audio/format.c | |
parent | 574bd127ecadb6d7cbcad9aea2187b05a433dda1 (diff) | |
download | mpv-5f8b060ec2dde7d0ff5468a5b7499851c22b756d.tar.bz2 mpv-5f8b060ec2dde7d0ff5468a5b7499851c22b756d.tar.xz |
ad_spdif: move frame sizes to a general function
Needed for the next commit. This commit should probably be reverted as
soon as we're working with full audio frames internally, instead of
"flat" FIFOs.
Diffstat (limited to 'audio/format.c')
-rw-r--r-- | audio/format.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/audio/format.c b/audio/format.c index 08b369c090..5e83ead1b2 100644 --- a/audio/format.c +++ b/audio/format.c @@ -227,3 +227,16 @@ int af_format_conversion_score(int dst_format, int src_format) score -= 2048; // has to convert float<->int return score; } + +int af_format_sample_alignment(int format) +{ + switch (format) { + case AF_FORMAT_S_AAC: return 16384; + case AF_FORMAT_S_AC3: return 6144; + case AF_FORMAT_S_DTSHD: return 32768; + case AF_FORMAT_S_EAC3: return 24576; + case AF_FORMAT_S_MP3: return 4608; + case AF_FORMAT_S_TRUEHD: return 61440; + default: return 1; + } +} |