flv: add support for G.711
[ffmpeg.git] / libavformat / flvenc.c
index 3caa6de..d77507d 100644 (file)
@@ -48,6 +48,8 @@ static const AVCodecTag flv_audio_codec_ids[] = {
     { CODEC_ID_ADPCM_SWF,  FLV_CODECID_ADPCM      >> FLV_AUDIO_CODECID_OFFSET },
     { CODEC_ID_AAC,        FLV_CODECID_AAC        >> FLV_AUDIO_CODECID_OFFSET },
     { CODEC_ID_NELLYMOSER, FLV_CODECID_NELLYMOSER >> FLV_AUDIO_CODECID_OFFSET },
+    { CODEC_ID_PCM_MULAW,  FLV_CODECID_PCM_MULAW  >> FLV_AUDIO_CODECID_OFFSET },
+    { CODEC_ID_PCM_ALAW,   FLV_CODECID_PCM_ALAW   >> FLV_AUDIO_CODECID_OFFSET },
     { CODEC_ID_SPEEX,      FLV_CODECID_SPEEX      >> FLV_AUDIO_CODECID_OFFSET },
     { CODEC_ID_NONE,       0 }
 };
@@ -136,6 +138,12 @@ static int get_audio_flags(AVFormatContext *s, AVCodecContext *enc)
         else
             flags |= FLV_CODECID_NELLYMOSER            | FLV_SAMPLESSIZE_16BIT;
         break;
+    case CODEC_ID_PCM_MULAW:
+        flags = FLV_CODECID_PCM_MULAW | FLV_SAMPLERATE_SPECIAL | FLV_SAMPLESSIZE_16BIT;
+        break;
+    case CODEC_ID_PCM_ALAW:
+        flags = FLV_CODECID_PCM_ALAW  | FLV_SAMPLERATE_SPECIAL | FLV_SAMPLESSIZE_16BIT;
+        break;
     case 0:
         flags |= enc->codec_tag << 4;
         break;