summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-26 14:31:36 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-26 14:31:36 +0000
commitf296563e5f41ca0d34675a99b2abe9c41a28bc39 (patch)
tree82f3c296d89ae70d0aee8dab565fe1d11661f8b7
parent042e0adda9fd3ae1322ef51f9edbceffe3ae0941 (diff)
move parameters reset after setting stream parameters, will need those infos
Originally committed as revision 12229 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mov.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index f5a7bbf06e..e0a3346482 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -805,27 +805,6 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
/* 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 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
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++) {