aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorDamien Fetis <damien.fetis@altervoice.com>2012-06-28 16:28:56 +0200
committerLuca Barbato <lu_zero@gentoo.org>2012-06-28 16:53:09 +0200
commitb92c7ee662b618518bff366af3274784fb141dde (patch)
treeab03526276e390b1ced02744244795158c603d78 /libavformat
parent433492ac65e1f08f8614348a968b76e9e6420022 (diff)
downloadffmpeg-b92c7ee662b618518bff366af3274784fb141dde.tar.gz
flv: add support for G.711
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/flv.h2
-rw-r--r--libavformat/flvdec.c8
-rw-r--r--libavformat/flvenc.c8
3 files changed, 18 insertions, 0 deletions
diff --git a/libavformat/flv.h b/libavformat/flv.h
index 6418b27419..fe0fc90d83 100644
--- a/libavformat/flv.h
+++ b/libavformat/flv.h
@@ -82,6 +82,8 @@ enum {
FLV_CODECID_NELLYMOSER_16KHZ_MONO = 4 << FLV_AUDIO_CODECID_OFFSET,
FLV_CODECID_NELLYMOSER_8KHZ_MONO = 5 << FLV_AUDIO_CODECID_OFFSET,
FLV_CODECID_NELLYMOSER = 6 << FLV_AUDIO_CODECID_OFFSET,
+ FLV_CODECID_PCM_ALAW = 7 << FLV_AUDIO_CODECID_OFFSET,
+ FLV_CODECID_PCM_MULAW = 8 << FLV_AUDIO_CODECID_OFFSET,
FLV_CODECID_AAC = 10<< FLV_AUDIO_CODECID_OFFSET,
FLV_CODECID_SPEEX = 11<< FLV_AUDIO_CODECID_OFFSET,
};
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 8e9759ba28..078c2a213e 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -108,6 +108,14 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, AVCodecCo
case FLV_CODECID_NELLYMOSER:
acodec->codec_id = CODEC_ID_NELLYMOSER;
break;
+ case FLV_CODECID_PCM_MULAW:
+ acodec->sample_rate = 8000;
+ acodec->codec_id = CODEC_ID_PCM_MULAW;
+ break;
+ case FLV_CODECID_PCM_ALAW:
+ acodec->sample_rate = 8000;
+ acodec->codec_id = CODEC_ID_PCM_ALAW;
+ break;
default:
av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n", flv_codecid >> FLV_AUDIO_CODECID_OFFSET);
acodec->codec_tag = flv_codecid >> FLV_AUDIO_CODECID_OFFSET;
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 3caa6ded99..d77507dd62 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -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;