From: Andre Noll Date: Sun, 20 Aug 2006 13:55:28 +0000 (+0200) Subject: osx_write: fix mono streams X-Git-Tag: v0.2.14~46 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=b5ff683a297e5223357c4edd968cc8e4ec17ed4f;p=paraslash.git 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. --- 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 */