summaryrefslogtreecommitdiff
path: root/libavformat/riff.c
diff options
context:
space:
mode:
authorMichel Bardiaux <mbardiaux@mediaxim.be>2007-02-20 11:09:47 +0000
committerMichel Bardiaux <mbardiaux@mediaxim.be>2007-02-20 11:09:47 +0000
commit346a655d467915a2a96019104d6ec7cdd859f1f9 (patch)
tree8c1dca31249aaaf9442dc6fab22111de687ce6d5 /libavformat/riff.c
parent758a6b3c061141af741c7dd777313f9d944ff86d (diff)
Add support for MS-GSM codec
Originally committed as revision 8039 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/riff.c')
-rw-r--r--libavformat/riff.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c
index cb6023cfa8..ffa35566a9 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -198,6 +198,7 @@ const AVCodecTag codec_wav_tags[] = {
{ CODEC_ID_TRUESPEECH, 0x22 },
{ CODEC_ID_FLAC, 0xF1AC },
{ CODEC_ID_IMC, 0x401 },
+ { CODEC_ID_GSM_MS, 0x31 },
/* FIXME: All of the IDs below are not 16 bit and thus illegal. */
// for NuppelVideo (nuv.c)
@@ -305,7 +306,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
enc->codec_id == CODEC_ID_PCM_ALAW ||
enc->codec_id == CODEC_ID_PCM_MULAW) {
bps = 8;
- } else if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3) {
+ } else if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3 || enc->codec_id == CODEC_ID_GSM_MS) {
bps = 0;
} else if (enc->codec_id == CODEC_ID_ADPCM_IMA_WAV || enc->codec_id == CODEC_ID_ADPCM_MS || enc->codec_id == CODEC_ID_ADPCM_G726 || enc->codec_id == CODEC_ID_ADPCM_YAMAHA) { //
bps = 4;
@@ -317,7 +318,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
bps = 16;
}
- if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3) {
+ if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3 || enc->codec_id == CODEC_ID_GSM_MS) {
blkalign = enc->frame_size; //this is wrong, but seems many demuxers dont work if this is set correctly
//blkalign = 144 * enc->bit_rate/enc->sample_rate;
} else if (enc->codec_id == CODEC_ID_ADPCM_G726) { //
@@ -356,6 +357,10 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
put_le16(pb, 16); /* fwHeadFlags */
put_le32(pb, 0); /* dwPTSLow */
put_le32(pb, 0); /* dwPTSHigh */
+ } else if (enc->codec_id == CODEC_ID_GSM_MS) {
+ put_le16(pb, 2); /* wav_extra_size */
+ hdrsize += 2;
+ put_le16(pb, enc->frame_size); /* wSamplesPerBlock */
} else if (enc->codec_id == CODEC_ID_ADPCM_IMA_WAV) {
put_le16(pb, 2); /* wav_extra_size */
hdrsize += 2;