changeset 1039:49b57ac270f7 libavformat

add mp3on4 detection, fix red.mp4
author bcoudurier
date Sun, 26 Mar 2006 16:54:53 +0000
parents 5c750fb6b8cc
children 3c523d59d55c
files mov.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Sun Mar 26 14:06:00 2006 +0000
+++ b/mov.c	Sun Mar 26 16:54:53 2006 +0000
@@ -600,6 +600,10 @@
             if (st->codec->extradata) {
                 get_buffer(pb, st->codec->extradata, len);
                 st->codec->extradata_size = len;
+                /* from mplayer */
+                if ((*(uint8_t *)st->codec->extradata >> 3) == 29) {
+                    st->codec->codec_id = CODEC_ID_MP3ON4;
+                }
             }
         }
     }
@@ -1134,11 +1138,17 @@
     if(st->codec->codec_type==CODEC_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) {
         st->codec->sample_rate= sc->time_scale;
     }
+
+    switch (st->codec->codec_id) {
 #ifdef CONFIG_FAAD
-    if(st->codec->codec_id ==CODEC_ID_AAC) {
-        st->codec->sample_rate= 0; /* let faad init parameters properly */
+    case CODEC_ID_AAC:
+#endif
+    case CODEC_ID_MP3ON4:
+        st->codec->sample_rate= 0; /* let decoder init parameters properly */
+        break;
+    default:
+        break;
     }
-#endif
 
     return 0;
 }