Now that we've selected a channel mapping for 7 and 8 channel flac, the
command-line encoder tools needs updating to accept wav files with
compatible channel maps.

 -r
>From 34e72dcae28c443a4a83ba6da5e2334b4865c5ed Mon Sep 17 00:00:00 2001
From: Ralph Giles <gi...@mozilla.com>
Date: Thu, 17 Jan 2013 16:21:45 -0800
Subject: [PATCH] Add appropriate WAV channel masks for 7 and 8 channel files.

This commit accepts the new default channel masks for 6.1 and 7.1
surround input WAV files, and writes the corresponding masks when
decoding to WAV without a channel mask from the metadata block.
---
 src/flac/decode.c | 5 +++++
 src/flac/encode.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/flac/decode.c b/src/flac/decode.c
index 98fc430..2d1bdd6 100644
--- a/src/flac/decode.c
+++ b/src/flac/decode.c
@@ -354,6 +354,11 @@ FLAC__bool DecoderSession_process(DecoderSession *d)
                else if(d->channels == 6) {
                        d->channel_mask = 0x060f;
                }
+                else if(d->channels == 7) {
+                        d->channel_mask = 0x070f;
+                }
+                else if(d->channels == 8) {
+                        d->channel_mask = 0x063f;
        }
 
        /* write the WAVE/AIFF headers if necessary */
diff --git a/src/flac/encode.c b/src/flac/encode.c
index eeea08a..58cdc77 100644
--- a/src/flac/encode.c
+++ b/src/flac/encode.c
@@ -481,7 +481,9 @@ static FLAC__bool get_sample_info_wave(EncoderSession *e, 
encode_options_t optio
                                        channel_mask == 0x0037 || /* 5 
channels: front left, front right, front center, back left, back right */
                                        channel_mask == 0x0607 || /* 5 
channels: front left, front right, front center, side left, side right */
                                        channel_mask == 0x003f || /* 6 
channels: front left, front right, front center, LFE, back left, back right */
-                                       channel_mask == 0x060f    /* 6 
channels: front left, front right, front center, LFE, side left, side right */
+                                       channel_mask == 0x060f || /* 6 
channels: front left, front right, front center, LFE, side left, side right */
+                                        channel_mask == 0x070f || /* 7 
channels: front left, front right, front center, LFE, back center, side left, 
side right */
+                                        channel_mask == 0x063f    /* 8 
channels: front left, front right, front center, LFE, back left, back right, 
side left, side right */
                                ) {
                                        /* keep default channel order */
                                }
-- 
1.7.12.4 (Apple Git-37)

_______________________________________________
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev

Reply via email to