[Mplayer-cvslog] CVS: main/libmpdemux demux_mov.c,1.15,1.16

Alex Beregszaszi alex at mplayer.dev.hu
Mon Oct 29 17:16:52 CET 2001


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

Modified Files:
	demux_mov.c 
Log Message:
changed if's to switch in lschunks

Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mov.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- demux_mov.c	26 Oct 2001 14:04:17 -0000	1.15
+++ demux_mov.c	29 Oct 2001 16:15:04 -0000	1.16
@@ -136,6 +136,7 @@
 #define MOV_TRAK_UNKNOWN 0
 #define MOV_TRAK_VIDEO 1
 #define MOV_TRAK_AUDIO 2
+#define MOV_TRAK_FLASH 3
 
 typedef struct {
     off_t moov_start;
@@ -373,9 +374,14 @@
 		lschunks(demuxer,level+1,pos+len,trak);
 		break;
 	    }
+	    default:
+		id = bswap_32(id);
+		mp_msg(MSGT_DEMUX,MSGL_V,"MOV: unknown chunk: %.4s %d\n",&id,(int)len);
+		break;
 	  }//switch(id)
-	} else
-	if(id==MOV_FOURCC('t','r','a','k')){
+	} else { /* not in track */
+	  switch(id) {
+	    case MOV_FOURCC('t','r','a','k'): {
 //	    if(trak) printf("MOV: Warning! trak in trak?\n");
 	    if(priv->track_db>=MOV_MAX_TRACKS){
 		mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_MOVtooManyTrk);
@@ -438,27 +444,33 @@
 		}
 		break;
 	    }
+	    default:
+		mp_msg(MSGT_DEMUX, MSGL_INFO, "Unknown track type found (type: %d)\n", trak->type);
+		break;
 	    }
 	    mp_msg(MSGT_DEMUX, MSGL_INFO, "--------------\n");
 	    priv->track_db++;
 	    trak=NULL;
-	} else
+	    break;
+	}
 #ifndef HAVE_ZLIB
-	if(id==MOV_FOURCC('c','m','o','v')){
+	case MOV_FOURCC('c','m','o','v'): {
 	    mp_msg(MSGT_DEMUX,MSGL_ERR,MSGTR_MOVcomprhdr);
 	    return;
 	}
 #else
-	if(id==MOV_FOURCC('c','m','o','v')){
+	case MOV_FOURCC('c','m','o','v'): {
 //	    mp_msg(MSGT_DEMUX,MSGL_ERR,MSGTR_MOVcomprhdr);
 	    lschunks(demuxer,level+1,pos+len,NULL);
-	} else
-	if(id==MOV_FOURCC('d','c','o','m')){
+	    break;
+	}
+	case MOV_FOURCC('d','c','o','m'): {
 //	    int temp=stream_read_dword(demuxer->stream);
 	    unsigned int len=bswap_32(stream_read_dword(demuxer->stream));
 	    mp_msg(MSGT_DEMUX, MSGL_INFO, "Compressed header uses %.4s algo!\n",&len);
-	} else
-	if(id==MOV_FOURCC('c','m','v','d')){
+	    break;
+	}
+	case MOV_FOURCC('c','m','v','d'): {
 //	    int temp=stream_read_dword(demuxer->stream);
 	    unsigned int moov_sz=stream_read_dword(demuxer->stream);
 	    unsigned int cmov_sz=len-4;
@@ -510,9 +522,10 @@
 	      demuxer->stream=backup;
 	      free(cmov_buf);
 	      free(moov_buf);	    
+	      break;
 	}
 #endif
-	else if (id==MOV_FOURCC('u','d','t','a'))
+	case MOV_FOURCC('u','d','t','a'):
 	{
 	    unsigned int udta_id;
 	    off_t udta_len;
@@ -584,7 +597,13 @@
 		    }
 		}
 	    }
+	    break;
 	} /* eof udta */
+	default:
+	  id = bswap_32(id);
+	  mp_msg(MSGT_DEMUX,MSGL_V,"MOV: unknown chunk: %.4s %d\n",&id,(int)len);
+	} /* endof switch */
+	} /* endof else */
 
 	pos+=len+8;
 	if(pos>=endpos) break;




More information about the MPlayer-cvslog mailing list