[FFmpeg-devel] [PATCH]Set frame_size for amr in mov

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Oct 28 11:22:33 CEST 2011


Hi!

Attached patch copies the behaviour of the amr demuxer.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 62d5b3c..c90004c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1350,10 +1350,13 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
         st->codec->frame_size= sc->samples_per_frame;
         st->codec->channels= 1; /* really needed */
         /* force sample rate for amr, stsd in 3gp does not store sample rate */
-        if (st->codec->codec_id == CODEC_ID_AMR_NB)
+        if (st->codec->codec_id == CODEC_ID_AMR_NB) {
             st->codec->sample_rate = 8000;
+            st->codec->frame_size  = 160;
-        else if (st->codec->codec_id == CODEC_ID_AMR_WB)
+        } else if (st->codec->codec_id == CODEC_ID_AMR_WB) {
             st->codec->sample_rate = 16000;
+            st->codec->frame_size  = 320;
+        }
         break;
     case CODEC_ID_MP2:
     case CODEC_ID_MP3:


More information about the ffmpeg-devel mailing list