# HG changeset patch # User reimar # Date 1263238858 0 # Node ID 9584cf67cea0caeef2fabbe4d20880a1c59462c8 # Parent cb2e10d85c04d7c5360e3f360a41a0bb641b0f62 Use af_fmt2bits, it should give more sensible values than snd_pcm_format_physical_width, especially for AC3. diff -r cb2e10d85c04 -r 9584cf67cea0 libao2/ao_alsa.c --- a/libao2/ao_alsa.c Mon Jan 11 19:37:50 2010 +0000 +++ b/libao2/ao_alsa.c Mon Jan 11 19:40:58 2010 +0000 @@ -574,7 +574,7 @@ return 0; } - bytes_per_sample = snd_pcm_format_physical_width(alsa_format) / 8; + bytes_per_sample = af_fmt2bits(ao_data.format) / 8; bytes_per_sample *= ao_data.channels; ao_data.bps = ao_data.samplerate * bytes_per_sample;