diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c index f66042a793..8fbcfbe2fc 100644 --- a/libao2/ao_dsound.c +++ b/libao2/ao_dsound.c @@ -327,7 +327,7 @@ static int write_buffer(unsigned char *data, int len) if (SUCCEEDED(res)) { - if( (ao_data.channels == 6) && (ao_data.format!=AF_FORMAT_AC3) ) { + if( (ao_data.channels == 6) && !AF_FORMAT_IS_AC3(ao_data.format) ) { // reorder channels while writing to pointers. // it's this easy because buffer size and len are always // aligned to multiples of channels*bytespersample @@ -456,7 +456,7 @@ static int init(int rate, int channels, int format, int flags) wformat.Format.cbSize = (channels > 2) ? sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX) : 0; wformat.Format.nChannels = channels; wformat.Format.nSamplesPerSec = rate; - if (format == AF_FORMAT_AC3) { + if (AF_FORMAT_IS_AC3(format)) { wformat.Format.wFormatTag = WAVE_FORMAT_DOLBY_AC3_SPDIF; wformat.Format.wBitsPerSample = 16; wformat.Format.nBlockAlign = 4; diff --git a/libao2/ao_win32.c b/libao2/ao_win32.c index a0475455ec..59e758793d 100644 --- a/libao2/ao_win32.c +++ b/libao2/ao_win32.c @@ -180,7 +180,7 @@ static int init(int rate,int channels,int format,int flags) wformat.Format.cbSize = (channels>2)?sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX):0; wformat.Format.nChannels = channels; wformat.Format.nSamplesPerSec = rate; - if(format == AF_FORMAT_AC3) + if(AF_FORMAT_IS_AC3(format)) { wformat.Format.wFormatTag = WAVE_FORMAT_DOLBY_AC3_SPDIF; wformat.Format.wBitsPerSample = 16;