alsa: add support for more formats.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 13 Jun 2011 19:16:30 +0000 (21:16 +0200)
committerAnton Khirnov <anton@khirnov.net>
Thu, 23 Jun 2011 06:49:48 +0000 (08:49 +0200)
Specifically, f32, f64, s32, s24, a-law and mu-law.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavdevice/alsa-audio-common.c

index ff6c9f8..4279790 100644 (file)
 static av_cold snd_pcm_format_t codec_id_to_pcm_format(int codec_id)
 {
     switch(codec_id) {
+        case CODEC_ID_PCM_F64LE: return SND_PCM_FORMAT_FLOAT64_LE;
+        case CODEC_ID_PCM_F64BE: return SND_PCM_FORMAT_FLOAT64_BE;
+        case CODEC_ID_PCM_F32LE: return SND_PCM_FORMAT_FLOAT_LE;
+        case CODEC_ID_PCM_F32BE: return SND_PCM_FORMAT_FLOAT_BE;
+        case CODEC_ID_PCM_S32LE: return SND_PCM_FORMAT_S32_LE;
+        case CODEC_ID_PCM_S32BE: return SND_PCM_FORMAT_S32_BE;
+        case CODEC_ID_PCM_S24LE: return SND_PCM_FORMAT_S24_3LE;
+        case CODEC_ID_PCM_S24BE: return SND_PCM_FORMAT_S24_3BE;
         case CODEC_ID_PCM_S16LE: return SND_PCM_FORMAT_S16_LE;
         case CODEC_ID_PCM_S16BE: return SND_PCM_FORMAT_S16_BE;
         case CODEC_ID_PCM_S8:    return SND_PCM_FORMAT_S8;
+        case CODEC_ID_PCM_MULAW: return SND_PCM_FORMAT_MU_LAW;
+        case CODEC_ID_PCM_ALAW:  return SND_PCM_FORMAT_A_LAW;
         default:                 return SND_PCM_FORMAT_UNKNOWN;
     }
 }