changeset 32776:15060bd7df4c

fix ad_qtaudio for the case when the libavformat mov demuxer is used
author faust3
date Sun, 06 Feb 2011 13:09:09 +0000
parents 3e141cd16ef3
children 9cc2689e5cd1
files libmpcodecs/ad_qtaudio.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_qtaudio.c	Sun Feb 06 11:45:17 2011 +0000
+++ b/libmpcodecs/ad_qtaudio.c	Sun Feb 06 13:09:09 2011 +0000
@@ -186,7 +186,11 @@
     unsigned long InputBufferSize=0; //size of the input buffer
     unsigned long OutputBufferSize=0; //size of the output buffer
     unsigned long WantedBufferSize=0; //the size you want your buffers to be
+    void* codecdata = sh->codecdata;
 
+    if (!sh->codecdata_len && sh->wf && sh->wf->cbSize){
+        codecdata = sh->wf + 1;
+    }
 
 #ifdef CONFIG_QUICKTIME
     EnterMovies();
@@ -217,8 +221,8 @@
     mp_msg(MSGT_DECAUDIO,MSGL_DBG2,"SoundConverterOpen:%i\n",error);
     if(error) return 0;
 
-    if(sh->codecdata){
-	error = SoundConverterSetInfo(myConverter,siDecompressionParams,sh->codecdata);
+    if(codecdata){
+	error = SoundConverterSetInfo(myConverter,siDecompressionParams,codecdata);
 	mp_msg(MSGT_DECAUDIO,MSGL_DBG2,"SoundConverterSetInfo:%i\n",error);
 //	if(error) return 0;
     }