changeset 146:b9703b3c10b6 libavformat

* 3gp patch by Joca
author kabi
date Thu, 05 Jun 2003 14:30:52 +0000
parents 4f3960430e54
children 2f924727fd96
files Makefile allformats.c avformat.h mov.c
diffstat 4 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Jun 03 13:58:44 2003 +0000
+++ b/Makefile	Thu Jun 05 14:30:52 2003 +0000
@@ -20,6 +20,10 @@
 OBJS+= asf.o
 endif
 
+ifeq ($(AMR_NB),yes)
+OBJS+= amr.o
+endif
+
 # image formats
 OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o
 # file I/O
--- a/allformats.c	Tue Jun 03 13:58:44 2003 +0000
+++ b/allformats.c	Thu Jun 05 14:30:52 2003 +0000
@@ -49,6 +49,9 @@
     dv_init();
     fourxm_init();
 
+#ifdef AMR_NB
+    amr_init();
+#endif
     av_register_output_format(&yuv4mpegpipe_oformat);
     
 #ifdef CONFIG_VORBIS
--- a/avformat.h	Tue Jun 03 13:58:44 2003 +0000
+++ b/avformat.h	Thu Jun 05 14:30:52 2003 +0000
@@ -310,6 +310,9 @@
 /* au.c */
 int au_init(void);
 
+/* amr.c */
+int amr_init(void);
+
 /* wav.c */
 int wav_init(void);
 
--- a/mov.c	Tue Jun 03 13:58:44 2003 +0000
+++ b/mov.c	Thu Jun 05 14:30:52 2003 +0000
@@ -1330,6 +1330,7 @@
         case MKTAG( 'f', 'r', 'e', 'e' ):
         case MKTAG( 'm', 'd', 'a', 't' ):
         case MKTAG( 'p', 'n', 'o', 't' ): /* detect movs with preview pics like ew.mov and april.mov */
+        case MKTAG( 'u', 'd', 't', 'a' ): /* Packet Video PVAuthor adds this and a lot of more junk */
             return AVPROBE_SCORE_MAX;
         case MKTAG( 'f', 't', 'y', 'p' ):
         case MKTAG( 's', 'k', 'i', 'p' ):
@@ -1486,6 +1487,33 @@
 	    && ((msc->chunk_offsets[msc->next_chunk] - offset) < size))
 	    size = msc->chunk_offsets[msc->next_chunk] - offset;
     }
+
+#ifdef MOV_MINOLTA_FIX
+    //Make sure that size is according to sample_size (Needed by .mov files 
+    //created on a Minolta Dimage Xi where audio chunks contains waste data in the end)
+    //Maybe we should really not only check sc->sample_size, but also sc->sample_sizes
+    //but I have no such movies
+    if (sc->sample_size > 0) { 
+        int foundsize=0;
+        for(i=0; i<(sc->sample_to_chunk_sz); i++) {
+            if( (sc->sample_to_chunk[i].first)<=(sc->next_chunk) && (sc->sample_size>0) )
+            {
+                foundsize=sc->sample_to_chunk[i].count*sc->sample_size;
+            }
+#ifdef DEBUG
+            /*printf("sample_to_chunk first=%ld count=%ld, id=%ld\n", sc->sample_to_chunk[i].first, sc->sample_to_chunk[i].count, sc->sample_to_chunk[i].id);*/
+#endif
+        }
+        if( (foundsize>0) && (foundsize<size) )
+        {
+#ifdef DEBUG
+            /*printf("this size should actually be %d\n",foundsize);*/
+#endif
+            size=foundsize;
+        }
+    }
+#endif //MOV_MINOLTA_FIX
+
 #ifdef MOV_SPLIT_CHUNKS
     /* split chunks into samples */
     if (sc->sample_size == 0) {