changeset 2330:8f0861360325

AVI - no audio stream fix
author arpi
date Sun, 21 Oct 2001 12:18:45 +0000
parents fc52a0a1626f
children 9e8585a7182e
files libmpdemux/aviheader.c libmpdemux/aviheader.h libmpdemux/demux_avi.c
diffstat 3 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/aviheader.c	Sun Oct 21 10:32:43 2001 +0000
+++ b/libmpdemux/aviheader.c	Sun Oct 21 12:18:45 2001 +0000
@@ -40,6 +40,7 @@
 
 //---- AVI header:
 priv->idx_size=0;
+priv->audio_streams=0;
 while(1){
   int id=stream_read_dword_le(demuxer->stream);
   int chunksize,size2;
@@ -141,6 +142,7 @@
 	}
         chunksize=0;
         if(verbose>=1) print_wave_header(sh_audio->wf);
+	++priv->audio_streams;
 //        if(demuxer->audio->id==-1) demuxer->audio->id=stream_id;
       }
       break;
--- a/libmpdemux/aviheader.h	Sun Oct 21 10:32:43 2001 +0000
+++ b/libmpdemux/aviheader.h	Sun Oct 21 12:18:45 2001 +0000
@@ -95,6 +95,7 @@
   int idx_offset;  // ennyit kell hozzaadni az index offset ertekekhez
   // interleaved PTS stuff:
   int skip_video_frames;
+  int audio_streams;
   float avi_audio_pts;
   float avi_video_pts;
   float pts_correction;
--- a/libmpdemux/demux_avi.c	Sun Oct 21 10:32:43 2001 +0000
+++ b/libmpdemux/demux_avi.c	Sun Oct 21 12:18:45 2001 +0000
@@ -456,7 +456,7 @@
   sh_video=d_video->sh;sh_video->ds=d_video;
   if(d_audio->id!=-2){
     mp_msg(MSGT_DEMUX,MSGL_V,"AVI: Searching for audio stream (id:%d)\n",d_audio->id);
-    if(!ds_fill_buffer(d_audio)){
+    if(!priv->audio_streams || !ds_fill_buffer(d_audio)){
       mp_msg(MSGT_DEMUX,MSGL_INFO,"AVI: " MSGTR_MissingAudioStream);
       sh_audio=NULL;
     } else {