[FFmpeg-cvslog] r21037 - in trunk: libavcodec/utils.c libavformat/riff.c

daniel subversion
Wed Jan 6 22:51:20 CET 2010


Author: daniel
Date: Wed Jan  6 22:51:20 2010
New Revision: 21037

Log:
Handle more ADPCM codecs in av_get_bits_per_sample().

This removes some special-case code from riff.c.
CODEC_ID_ADPCM_G726 is still handled in riff.c as before because it is
not guaranteed to be fixed 4 bits per sample.

Modified:
   trunk/libavcodec/utils.c
   trunk/libavformat/riff.c

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	Wed Jan  6 17:22:15 2010	(r21036)
+++ trunk/libavcodec/utils.c	Wed Jan  6 22:51:20 2010	(r21037)
@@ -963,6 +963,9 @@ int av_get_bits_per_sample(enum CodecID 
         return 3;
     case CODEC_ID_ADPCM_SBPRO_4:
     case CODEC_ID_ADPCM_CT:
+    case CODEC_ID_ADPCM_WAV:
+    case CODEC_ID_ADPCM_MS:
+    case CODEC_ID_ADPCM_YAMAHA:
         return 4;
     case CODEC_ID_PCM_ALAW:
     case CODEC_ID_PCM_MULAW:

Modified: trunk/libavformat/riff.c
==============================================================================
--- trunk/libavformat/riff.c	Wed Jan  6 17:22:15 2010	(r21036)
+++ trunk/libavformat/riff.c	Wed Jan  6 22:51:20 2010	(r21037)
@@ -336,7 +336,7 @@ int ff_put_wav_header(ByteIOContext *pb,
     put_le32(pb, enc->sample_rate);
     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) { //
+    } else if (enc->codec_id == CODEC_ID_ADPCM_G726) {
         bps = 4;
     } else {
         if (!(bps = av_get_bits_per_sample(enc->codec_id)))



More information about the ffmpeg-cvslog mailing list