changeset 20337:fccb66884d60

Avoid crash after "AVI: No audio stream found -> no sound." message, audio was not correctly disabled.
author reimar
date Sat, 21 Oct 2006 20:48:41 +0000
parents 2796a2d0e8c8
children e5902385e9e1
files libmpdemux/demux_avi.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_avi.c	Sat Oct 21 20:14:11 2006 +0000
+++ b/libmpdemux/demux_avi.c	Sat Oct 21 20:48:41 2006 +0000
@@ -470,7 +470,7 @@
       }
       if(a_pos==-1){
         mp_msg(MSGT_DEMUX,MSGL_INFO,"AVI_NI: " MSGTR_MissingAudioStream);
-        sh_audio=NULL;
+        d_audio->sh=sh_audio=NULL;
       } else {
         if(force_ni || abs(a_pos-v_pos)>0x100000){  // distance > 1MB
           mp_msg(MSGT_DEMUX,MSGL_INFO,MSGTR_NI_Message,force_ni?MSGTR_NI_Forced:MSGTR_NI_Detected);
@@ -500,7 +500,7 @@
     mp_msg(MSGT_DEMUX,MSGL_V,"AVI: Searching for audio stream (id:%d)\n",d_audio->id);
     if(!priv->audio_streams || !ds_fill_buffer(d_audio)){
       mp_msg(MSGT_DEMUX,MSGL_INFO,"AVI: " MSGTR_MissingAudioStream);
-      sh_audio=NULL;
+      d_audio->sh=sh_audio=NULL;
     } else {
       sh_audio=d_audio->sh;sh_audio->ds=d_audio;
       sh_audio->format=sh_audio->wf->wFormatTag;