changeset 15576:82fe45e7ca77

setting sh_audio to NULL is nonsense, since it is only a local variable, use d_audio->sh instead. Fixes crash for incoming/VTS_01_1_orig.VOB, though it still doesn't select the other audio stream automatically.
author reimar
date Fri, 27 May 2005 12:38:29 +0000
parents b8cdc8b98466
children 4f55a470dcb3
files libmpdemux/demuxer.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demuxer.c	Fri May 27 11:14:22 2005 +0000
+++ b/libmpdemux/demuxer.c	Fri May 27 12:38:29 2005 +0000
@@ -1291,14 +1291,14 @@
   demux_open_lmlm4(demuxer);
   if(!ds_fill_buffer(d_video)){
     mp_msg(MSGT_DEMUXER,MSGL_INFO,"LMLM4: " MSGTR_MissingVideoStream);
-    sh_video=NULL;
+    d_video->sh=NULL;
   } else {
     sh_video=d_video->sh;sh_video->ds=d_video;
   }
   if(audio_id!=-2) {
    if(!ds_fill_buffer(d_audio)){
     mp_msg(MSGT_DEMUXER,MSGL_INFO,"LMLM4: " MSGTR_MissingAudioStream);
-    sh_audio=NULL;
+    d_audio->sh=NULL;
    } else {
     sh_audio=d_audio->sh;sh_audio->ds=d_audio;
    }
@@ -1319,7 +1319,7 @@
   if(d_video->id != -2) {
     if(!ds_fill_buffer(d_video)){
       mp_msg(MSGT_DEMUXER,MSGL_WARN,"ASF: " MSGTR_MissingVideoStream);
-      sh_video=NULL;
+      d_video->sh=NULL;
       //printf("ASF: missing video stream!? contact the author, it may be a bug :(\n");
     } else {
       sh_video=d_video->sh;sh_video->ds=d_video;
@@ -1331,7 +1331,7 @@
     mp_msg(MSGT_DEMUXER,MSGL_V,MSGTR_ASFSearchingForAudioStream,d_audio->id);
     if(!ds_fill_buffer(d_audio)){
       mp_msg(MSGT_DEMUXER,MSGL_INFO,"ASF: " MSGTR_MissingAudioStream);
-      sh_audio=NULL;
+      d_audio->sh=NULL;
     } else {
       sh_audio=d_audio->sh;sh_audio->ds=d_audio;
       sh_audio->format=sh_audio->wf->wFormatTag;
@@ -1342,7 +1342,7 @@
  case DEMUXER_TYPE_H264_ES:
  case DEMUXER_TYPE_MPEG4_ES:
  case DEMUXER_TYPE_MPEG_ES: {
-   sh_audio=NULL;   // ES streams has no audio channel
+   d_audio->sh=NULL;   // ES streams has no audio channel
    d_video->sh=new_sh_video(demuxer,0); // create dummy video stream header, id=0
    sh_video=d_video->sh;sh_video->ds=d_video;
    break;
@@ -1356,7 +1356,7 @@
   if(audio_id!=-2) {
    if(!ds_fill_buffer(d_audio)){
     mp_msg(MSGT_DEMUXER,MSGL_INFO,"MPEG: " MSGTR_MissingAudioStream);
-    sh_audio=NULL;
+    d_audio->sh=NULL;
    } else {
     sh_audio=d_audio->sh;sh_audio->ds=d_audio;
    }