[Mplayer-cvslog] CVS: main/libmpdemux demux_nsv.c,1.3,1.4

Roberto Togni CVS syncmail at mplayerhq.hu
Tue Apr 13 21:56:50 CEST 2004


CVS change done by Roberto Togni CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv2236

Modified Files:
	demux_nsv.c 
Log Message:
Do not crash on audio only streams


Index: demux_nsv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_nsv.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- demux_nsv.c	12 Apr 2004 23:58:06 -0000	1.3
+++ demux_nsv.c	13 Apr 2004 19:56:48 -0000	1.4
@@ -143,20 +143,7 @@
     nsv_priv_t * priv = malloc(sizeof(nsv_priv_t));
     demuxer->priv=priv;
     priv->video_pack_no=0;
-    /* Create a new video stream header */
-    sh_video = new_sh_video ( demuxer, 0 );
 
-    /* Make sure the demuxer knows about the new video stream header
-     * (even though new_sh_video() ought to take care of it)
-     */
-    demuxer->video->sh = sh_video;
-
-    /* Make sure that the video demuxer stream header knows about its
-     * parent video demuxer stream (this is getting wacky), or else
-     * video_read_properties() will choke
-         */
-    sh_video->ds = demuxer->video;
-        
       /* disable seeking yet to be fixed*/
     demuxer->seekable = 0;
         
@@ -240,6 +227,20 @@
         priv->fps=hdr[16];
             
         if (strncmp(hdr+4,"NONE", 4)) {
+            /* Create a new video stream header */
+            sh_video = new_sh_video ( demuxer, 0 );
+
+            /* Make sure the demuxer knows about the new video stream header
+             * (even though new_sh_video() ought to take care of it)
+             */
+            demuxer->video->sh = sh_video;
+
+            /* Make sure that the video demuxer stream header knows about its
+             * parent video demuxer stream (this is getting wacky), or else
+             * video_read_properties() will choke
+             */
+            sh_video->ds = demuxer->video;
+        
             //   bytes 4-7  video codec fourcc
             priv->v_format = sh_video->format=mmioFOURCC(hdr[4],hdr[5],hdr[6],hdr[7]);
         
@@ -285,7 +286,6 @@
 
                 stream_seek(demuxer->stream,stream_tell(demuxer->stream)-9);
             } 
-        }
 
             
         switch(priv->fps){
@@ -308,6 +308,7 @@
             sh_video->fps = (float)priv->fps;
         }       
         sh_video->frametime = (float)1.0 / (float)sh_video->fps;
+       }
     }   
 
     




More information about the MPlayer-cvslog mailing list