changeset 30235:53c43f683cd7

Use af_fmt2bits instead of reimplementing it.
author reimar
date Mon, 11 Jan 2010 19:26:33 +0000
parents 9d09ff127c25
children cb2e10d85c04
files libao2/ao_coreaudio.c
diffstat 1 files changed, 1 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_coreaudio.c	Mon Jan 11 19:23:18 2010 +0000
+++ b/libao2/ao_coreaudio.c	Mon Jan 11 19:26:33 2010 +0000
@@ -314,23 +314,7 @@
 	inDesc.mSampleRate=rate;
 	inDesc.mFormatID=ao->b_supports_digital ? kAudioFormat60958AC3 : kAudioFormatLinearPCM;
 	inDesc.mChannelsPerFrame=channels;
-	switch(format&AF_FORMAT_BITS_MASK){
-	case AF_FORMAT_8BIT:
-		inDesc.mBitsPerChannel=8;
-		break;
-	case AF_FORMAT_16BIT:
-		inDesc.mBitsPerChannel=16;
-		break;
-	case AF_FORMAT_24BIT:
-		inDesc.mBitsPerChannel=24;
-		break;
-	case AF_FORMAT_32BIT:
-		inDesc.mBitsPerChannel=32;
-		break;
-	default:
-		ao_msg(MSGT_AO, MSGL_WARN, "Unsupported format (0x%08x)\n", format);
-		goto err_out;
-	}
+	inDesc.mBitsPerChannel=af_fmt2bits(format);
 
     if((format&AF_FORMAT_POINT_MASK)==AF_FORMAT_F) {
 	// float