From b5ff683a297e5223357c4edd968cc8e4ec17ed4f Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 20 Aug 2006 15:55:28 +0200 Subject: [PATCH] osx_write: fix mono streams The old code had a hardcoded channels count of two. Use the value from the command line or the writer node group information instead. --- osx_writer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/osx_writer.c b/osx_writer.c index c4a97e4b..54a1acd1 100644 --- a/osx_writer.c +++ b/osx_writer.c @@ -51,6 +51,7 @@ struct private_osx_writer_data { osx_buffer *from; /* Current buffers */ osx_buffer *to; unsigned samplerate; + unsigned channels; }; @@ -223,12 +224,12 @@ static int osx_writer_open(struct writer_node *wn) format.mFormatFlags = kLinearPCMFormatFlagIsFloat | kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsBigEndian; - /* - * We produce 2-channel audio. Now if we have a mega-super-hyper card for our - * audio, it is its problem to convert it to 8-, 16-, 32- or 1024-channel data. - */ + if (!conf->channels_given && wng->channels) + powd->channels = *wng->channels; + else + powd->channels = conf->channels_arg; + format.mChannelsPerFrame = powd->channels; format.mFramesPerPacket = 1; - format.mChannelsPerFrame = 2; format.mBytesPerPacket = format.mChannelsPerFrame * sizeof(float); format.mBytesPerFrame = format.mFramesPerPacket * format.mBytesPerPacket; /* one of the most constant constants of the whole computer history */ -- 2.39.2