[MPlayer-cvslog] r36906 - trunk/libmpdemux/demux_mpg.c

reimar subversion at mplayerhq.hu
Sun Feb 23 19:02:21 CET 2014


Author: reimar
Date: Sun Feb 23 19:02:21 2014
New Revision: 36906

Log:
Fix crashes with -novideo.

Mostly caused by trying to set sh->ds, which
is completely pointless since it's already set
by the new_sh_* functions.

Modified:
   trunk/libmpdemux/demux_mpg.c

Modified: trunk/libmpdemux/demux_mpg.c
==============================================================================
--- trunk/libmpdemux/demux_mpg.c	Sun Feb 23 18:42:01 2014	(r36905)
+++ trunk/libmpdemux/demux_mpg.c	Sun Feb 23 19:02:21 2014	(r36906)
@@ -1082,12 +1082,9 @@ static int demux_mpg_pes_probe(demuxer_t
 
 static demuxer_t* demux_mpg_es_open(demuxer_t* demuxer)
 {
-    sh_video_t *sh_video=NULL;
-
     demuxer->audio->sh = NULL;   // ES streams has no audio channel
     demuxer->video->sh = new_sh_video(demuxer,0); // create dummy video stream header, id=0
     demuxer->video->id = 0;
-    sh_video=demuxer->video->sh;sh_video->ds=demuxer->video;
 
     return demuxer;
 }
@@ -1096,28 +1093,22 @@ static demuxer_t *demux_mpg_gxf_open(dem
   demuxer->audio->sh = NULL;
   demuxer->video->sh = new_sh_video(demuxer,0);
   demuxer->video->id = 0;
-  ((sh_video_t *)demuxer->video->sh)->ds = demuxer->video;
   demuxer->priv = (void *) 0xffffffff;
   return demuxer;
 }
 
 static demuxer_t* demux_mpg_ps_open(demuxer_t* demuxer)
 {
-    sh_audio_t *sh_audio=NULL;
-    sh_video_t *sh_video=NULL;
-
-    sh_video=demuxer->video->sh;sh_video->ds=demuxer->video;
+    sh_video_t *sh_video = demuxer->video->sh;
 
     if(demuxer->audio->id!=-2) {
         if(!ds_fill_buffer(demuxer->audio)){
             mp_msg(MSGT_DEMUXER,MSGL_INFO,"MPEG: " MSGTR_MissingAudioStream);
             demuxer->audio->sh=NULL;
-        } else {
-            sh_audio=demuxer->audio->sh;sh_audio->ds=demuxer->audio;
         }
     }
 
-    if(!sh_video->format && ps_probe > 0) {
+    if(sh_video && !sh_video->format && ps_probe > 0) {
         int head;
         off_t pos = stream_tell(demuxer->stream);
 


More information about the MPlayer-cvslog mailing list