changeset 3081:e9f7c2764298 libavformat

move parameters reset after setting stream parameters, will need those infos
author bcoudurier
date Tue, 26 Feb 2008 14:31:36 +0000
parents bde591fe6ddb
children 2879ea685e81
files mov.c
diffstat 1 files changed, 24 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Tue Feb 26 10:21:33 2008 +0000
+++ b/mov.c	Tue Feb 26 14:31:36 2008 +0000
@@ -805,27 +805,6 @@
 
     /* special codec parameters handling */
     switch (st->codec->codec_id) {
-#ifdef CONFIG_H261_DECODER
-    case CODEC_ID_H261:
-#endif
-#ifdef CONFIG_H263_DECODER
-    case CODEC_ID_H263:
-#endif
-#ifdef CONFIG_MPEG4_DECODER
-    case CODEC_ID_MPEG4:
-#endif
-        st->codec->width= 0; /* let decoder init width/height */
-        st->codec->height= 0;
-        break;
-#ifdef CONFIG_LIBFAAD
-    case CODEC_ID_AAC:
-#endif
-#ifdef CONFIG_VORBIS_DECODER
-    case CODEC_ID_VORBIS:
-#endif
-    case CODEC_ID_MP3ON4:
-        st->codec->sample_rate= 0; /* let decoder init parameters properly */
-        break;
 #ifdef CONFIG_DV_DEMUXER
     case CODEC_ID_DVAUDIO:
         c->dv_fctx = av_alloc_format_context();
@@ -1472,6 +1451,30 @@
         }
         sc->ffindex = i;
         mov_build_index(mov, st);
+
+        switch (st->codec->codec_id) {
+#ifdef CONFIG_H261_DECODER
+        case CODEC_ID_H261:
+#endif
+#ifdef CONFIG_H263_DECODER
+        case CODEC_ID_H263:
+#endif
+#ifdef CONFIG_MPEG4_DECODER
+        case CODEC_ID_MPEG4:
+#endif
+            st->codec->width= 0; /* let decoder init width/height */
+            st->codec->height= 0;
+            break;
+#ifdef CONFIG_LIBFAAD
+        case CODEC_ID_AAC:
+#endif
+#ifdef CONFIG_VORBIS_DECODER
+        case CODEC_ID_VORBIS:
+#endif
+        case CODEC_ID_MP3ON4:
+            st->codec->sample_rate= 0; /* let decoder init parameters properly */
+            break;
+        }
     }
 
     for(i=0; i<s->nb_streams; i++) {