[Ffmpeg-cvslog] r6636 - trunk/libavformat/amr.c

michael subversion
Wed Oct 11 01:56:49 CEST 2006


Author: michael
Date: Wed Oct 11 01:56:49 2006
New Revision: 6636

Modified:
   trunk/libavformat/amr.c

Log:
more factoriztaion and a FIXME note


Modified: trunk/libavformat/amr.c
==============================================================================
--- trunk/libavformat/amr.c	(original)
+++ trunk/libavformat/amr.c	Wed Oct 11 01:56:49 2006
@@ -91,6 +91,11 @@
 
     get_buffer(pb, header, 6);
 
+    st = av_new_stream(s, 0);
+    if (!st)
+    {
+        return AVERROR_NOMEM;
+    }
     if(memcmp(header,AMR_header,6)!=0)
     {
         get_buffer(pb, header+6, 3);
@@ -98,11 +103,6 @@
         {
             return -1;
         }
-        st = av_new_stream(s, 0);
-        if (!st)
-        {
-            return AVERROR_NOMEM;
-        }
 
         st->codec->codec_tag = MKTAG('s', 'a', 'w', 'b');
         st->codec->codec_id = CODEC_ID_AMR_WB;
@@ -110,12 +110,6 @@
     }
     else
     {
-        st = av_new_stream(s, 0);
-        if (!st)
-        {
-            return AVERROR_NOMEM;
-        }
-
         st->codec->codec_tag = MKTAG('s', 'a', 'm', 'r');
         st->codec->codec_id = CODEC_ID_AMR_NB;
         st->codec->sample_rate = 8000;
@@ -140,6 +134,7 @@
         return AVERROR_IO;
     }
 
+//FIXME this is wrong, this should rather be in a AVParset
     toc=get_byte(&s->pb);
     mode = (toc >> 3) & 0x0F;
 




More information about the ffmpeg-cvslog mailing list