[Ffmpeg-cvslog] r5640 - trunk/libavformat/movenc.c

bcoudurier subversion
Thu Jul 6 16:38:50 CEST 2006


Author: bcoudurier
Date: Thu Jul  6 16:38:50 2006
New Revision: 5640

Modified:
   trunk/libavformat/movenc.c

Log:
simplify and write correct values conforming to specs

Modified: trunk/libavformat/movenc.c
==============================================================================
--- trunk/libavformat/movenc.c	(original)
+++ trunk/libavformat/movenc.c	Thu Jul  6 16:38:50 2006
@@ -200,29 +200,17 @@
     return updateSize (pb, pos);
 }
 
-static int mov_write_damr_tag(ByteIOContext *pb)
+static int mov_write_amr_tag(ByteIOContext *pb, MOVTrack *track)
 {
     put_be32(pb, 0x11); /* size */
-    put_tag(pb, "damr");
+    if (track->mode == MODE_MOV) put_tag(pb, "samr");
+    else                         put_tag(pb, "damr");
     put_tag(pb, "FFMP");
-    put_byte(pb, 0);
-
-    //put_be16(pb, 0x80); /* Mode set (all modes for AMR_NB) */
-    //put_be16(pb, 0xa); /* Mode change period (no restriction) */
-    put_be16(pb, 0x81ff); /* Mode set (all modes for AMR_NB) */
-    put_be16(pb, 1); /* Mode change period (no restriction) */
-    return 0x11;
-}
-
-static int mov_write_samr_tag(ByteIOContext *pb)
-{
-    put_be32(pb, 0x11); /* size */
-    put_tag(pb, "samr");
-    put_tag(pb, "FFMP");
-    put_byte(pb, 1);
+    put_byte(pb, 0); /* decoder version */
 
     put_be16(pb, 0x80); /* Mode set (all modes for AMR_NB) */
-    put_be16(pb, 0x5); /* Mode change period (no restriction) */
+    put_byte(pb, 0x00); /* Mode change period (no restriction) */
+    put_byte(pb, 0x01); /* Frames per sample */
     return 0x11;
 }
 
@@ -322,7 +310,7 @@
                track->enc->codec_id == CODEC_ID_PCM_S32LE) {
         mov_write_enda_tag(pb);
     } else if (track->enc->codec_id == CODEC_ID_AMR_NB) {
-        mov_write_samr_tag(pb);
+        mov_write_amr_tag(pb, track);
     }
 
     put_be32(pb, 8);     /* size */
@@ -404,7 +392,7 @@
     else if(track->enc->codec_id == CODEC_ID_AAC)
         mov_write_esds_tag(pb, track);
     else if(track->enc->codec_id == CODEC_ID_AMR_NB)
-        mov_write_damr_tag(pb);
+        mov_write_amr_tag(pb, track);
 
     return updateSize (pb, pos);
 }




More information about the ffmpeg-cvslog mailing list