[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec cinepak.c,1.9,1.10

Mike Melanson CVS melanson
Sun Aug 14 20:40:02 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv31044/libavcodec

Modified Files:
	cinepak.c 
Log Message:
automatically detect Cinepak data from Sega FILM/CPK files


Index: cinepak.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/cinepak.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cinepak.c	11 Jul 2005 22:34:34 -0000	1.9
+++ cinepak.c	14 Aug 2005 18:39:59 -0000	1.10
@@ -316,13 +316,22 @@
     uint8_t      *eod = (s->data + s->size);
     int           i, result, strip_size, frame_flags, num_strips;
     int           y0 = 0;
+    int           encoded_buf_size;
+    /* if true, Cinepak data is from a Sega FILM/CPK file */
+    int           sega_film_data = 0;
 
     if (s->size < 10)
         return -1;
 
     frame_flags = s->data[0];
     num_strips  = BE_16 (&s->data[8]);
-    s->data    += 10;
+    encoded_buf_size = BE_16 (&s->data[2]);
+    if (encoded_buf_size != s->size)
+        sega_film_data = 1;
+    if (sega_film_data)
+        s->data    += 12;
+    else
+        s->data    += 10;
 
     if (num_strips > MAX_STRIPS)
         num_strips = MAX_STRIPS;





More information about the ffmpeg-cvslog mailing list