[Mplayer-cvslog] CVS: main/libmpdemux demux_mov.c,1.34,1.35

Arpi of Ize arpi at mplayer.dev.hu
Sun Feb 10 01:45:59 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv30835

Modified Files:
	demux_mov.c 
Log Message:
fixedsize video samples fixed (dvntsc-qt.mov)

Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mov.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- demux_mov.c	5 Feb 2002 04:08:05 -0000	1.34
+++ demux_mov.c	10 Feb 2002 00:45:56 -0000	1.35
@@ -53,6 +53,13 @@
     unsigned int dur;
 } mov_durmap_t;
 
+#define MOV_TRAK_UNKNOWN 0
+#define MOV_TRAK_VIDEO 1
+#define MOV_TRAK_AUDIO 2
+#define MOV_TRAK_FLASH 3
+#define MOV_TRAK_GENERIC 4
+#define MOV_TRAK_CODE 5
+
 typedef struct {
     int id;
     int type;
@@ -132,6 +139,15 @@
         s+=trak->chunks[j].size;
     }
 
+    // workaround for fixed-size video frames (dv and uncompressed)
+    if(!trak->samples_size && trak->type==MOV_TRAK_VIDEO){
+	trak->samples_size=s;
+	trak->samples=malloc(sizeof(mov_sample_t)*s);
+	for(i=0;i<s;i++)
+	    trak->samples[i].size=trak->samplesize;
+	trak->samplesize=0;
+    }
+
     if(!trak->samples_size){
 	// constant sampesize
 	if(trak->durmap_size==1 || (trak->durmap_size==2 && trak->durmap[1].num==1)){
@@ -169,13 +185,6 @@
 
 #define MOV_MAX_TRACKS 256
 
-#define MOV_TRAK_UNKNOWN 0
-#define MOV_TRAK_VIDEO 1
-#define MOV_TRAK_AUDIO 2
-#define MOV_TRAK_FLASH 3
-#define MOV_TRAK_GENERIC 4
-#define MOV_TRAK_CODE 5
-
 typedef struct {
     off_t moov_start;
     off_t moov_end;
@@ -945,7 +954,7 @@
     else
 	x=trak->chunks[trak->pos].size;
 //    printf("X = %d\n", x);
-    if(trak->stdata_len>=36){
+    if(trak->stdata_len>=36 && trak->stdata[30] && trak->stdata[31]){
 	// extended stsd header - works for CBR MP3:
 	x/=(trak->stdata[30]<<8)+trak->stdata[31];  // samples/packet
 	// x*=(trak->stdata[34]<<8)+trak->stdata[35];  // bytes/packet




More information about the MPlayer-cvslog mailing list