diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2009-10-16 03:02:25 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2009-10-16 03:02:25 +0000 |
commit | 046c40010390af94bf3379f7e1eff9b5a5ddd250 (patch) | |
tree | 3df24f8dcfa944308ac3d6b951f495f41388ec44 | |
parent | 75df2edbb915f5faa0ee67d8d36d94a68e584fc0 (diff) | |
download | ffmpeg-046c40010390af94bf3379f7e1eff9b5a5ddd250.tar.gz |
Add Speex support to the FLV muxer.
Originally committed as revision 20245 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/avformat.h | 2 | ||||
-rw-r--r-- | libavformat/flvenc.c | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ddb3ffadb4..19914b6d66 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -23,7 +23,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 52 #define LIBAVFORMAT_VERSION_MINOR 39 -#define LIBAVFORMAT_VERSION_MICRO 1 +#define LIBAVFORMAT_VERSION_MICRO 2 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index f616889a34..183f137b4f 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -43,6 +43,7 @@ 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_SPEEX, FLV_CODECID_SPEEX >> FLV_AUDIO_CODECID_OFFSET}, {CODEC_ID_NONE, 0} }; @@ -59,7 +60,22 @@ static int get_audio_flags(AVCodecContext *enc){ if (enc->codec_id == CODEC_ID_AAC) // specs force these parameters return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ | FLV_SAMPLESSIZE_16BIT | FLV_STEREO; - else { + else if (enc->codec_id == CODEC_ID_SPEEX) { + if (enc->sample_rate != 16000) { + av_log(enc, AV_LOG_ERROR, "flv only supports wideband (16kHz) Speex audio\n"); + return -1; + } + if (enc->channels != 1) { + av_log(enc, AV_LOG_ERROR, "flv only supports mono Speex audio\n"); + return -1; + } + if (enc->frame_size / 320 > 8) { + av_log(enc, AV_LOG_WARNING, "Warning: Adobe Flash Player is known " + "to have trouble with Speex streams " + "with more than 8 frames per packet.\n"); + } + return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ | FLV_SAMPLESSIZE_16BIT; + } else { switch (enc->sample_rate) { case 44100: flags |= FLV_SAMPLERATE_44100HZ; |