changeset 23965:8d4b1bda30f1

Fix detection of xan audio. -noidx or -forceidx still is necessary to detect audio at all.
author reimar
date Wed, 01 Aug 2007 09:01:28 +0000
parents 918dd2856cb6
children fb3bdf4cc3c2
files libmpdemux/aviheader.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/aviheader.c	Wed Aug 01 08:45:46 2007 +0000
+++ b/libmpdemux/aviheader.c	Wed Aug 01 09:01:28 2007 +0000
@@ -64,6 +64,7 @@
   int id=stream_read_dword_le(demuxer->stream);
   unsigned chunksize,size2;
   static int last_fccType=0;
+  static int last_fccHandler=0;
   char* hdr=NULL;
   //
   if(stream_eof(demuxer->stream)) break;
@@ -203,6 +204,7 @@
         sh_audio->stream_delay = (float)sh_audio->audio.dwStart * sh_audio->audio.dwScale/sh_audio->audio.dwRate;
       }
       last_fccType=h.fccType;
+      last_fccHandler=h.fccHandler;
       if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_strh(&h,MSGL_V);
       break; }
     case mmioFOURCC('i', 'n', 'd', 'x'): {
@@ -323,6 +325,9 @@
 	    sh_audio->wf=realloc(sh_audio->wf, sizeof(WAVEFORMATEX)+sh_audio->wf->cbSize);
 	}
 	sh_audio->format=sh_audio->wf->wFormatTag;
+	if (sh_audio->format == 1 &&
+	    last_fccHandler == mmioFOURCC('A', 'x', 'a', 'n'))
+	    sh_audio->format = last_fccHandler;
 	sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec;
         chunksize=0;
         if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf,MSGL_V);