[Mplayer-cvslog] CVS: main dec_audio.c,1.87,1.88

Atmosfear atmos4 at mplayer.dev.hu
Tue Mar 19 22:48:57 CET 2002


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv31523

Modified Files:
	dec_audio.c 
Log Message:
allow sh_audio struct to be initialized by demuxer, add parsing of mp4 esds header to mov demuxer, init faad from info from mov header

Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_audio.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- dec_audio.c	18 Mar 2002 23:30:04 -0000	1.87
+++ dec_audio.c	19 Mar 2002 21:48:44 -0000	1.88
@@ -328,15 +328,17 @@
 int init_audio(sh_audio_t *sh_audio){
 int driver=sh_audio->codec->driver;
 
-sh_audio->samplesize=2;
+if(!sh_audio->samplesize)
+  sh_audio->samplesize=2;
+if(!sh_audio->sample_format)
 #ifdef WORDS_BIGENDIAN
-sh_audio->sample_format=AFMT_S16_BE;
+  sh_audio->sample_format=AFMT_S16_BE;
 #else
-sh_audio->sample_format=AFMT_S16_LE;
+  sh_audio->sample_format=AFMT_S16_LE;
 #endif
-sh_audio->samplerate=0;
+//sh_audio->samplerate=0;
 //sh_audio->pcm_bswap=0;
-sh_audio->o_bps=0;
+//sh_audio->o_bps=0;
 
 sh_audio->a_buffer_size=0;
 sh_audio->a_buffer=NULL;
@@ -840,16 +842,15 @@
   faacDecConfigurationPtr faac_conf;
   faac_hdec = faacDecOpen();
 
-#if 0
+#if 1
   /* Set the default object type and samplerate */
   /* This is useful for RAW AAC files */
   faac_conf = faacDecGetCurrentConfiguration(faac_hdec);
   if(sh_audio->samplerate)
     faac_conf->defSampleRate = sh_audio->samplerate;
-  /* XXX: is outputFormat samplesize of compressed data or samplesize of
-   * decoded data, maybe upsampled? Also, FAAD support FLOAT output,
-   * how do we handle that (FAAD_FMT_FLOAT)? ::atmos
-   */
+   /* XXX: FAAD support FLOAT output, how do we handle
+    * that (FAAD_FMT_FLOAT)? ::atmos
+    */
   if(sh_audio->samplesize)
     switch(sh_audio->samplesize){
       case 1: // 8Bit
@@ -865,7 +866,7 @@
 	faac_conf->outputFormat = FAAD_FMT_32BIT;
 	break;
     }
-  faac_conf->defObjectType = LTP; // => MAIN, LC, SSR, LTP available.
+  //faac_conf->defObjectType = LTP; // => MAIN, LC, SSR, LTP available.
 
   faacDecSetConfiguration(faac_hdec, faac_conf);
 #endif
@@ -887,7 +888,11 @@
     mp_msg(MSGT_DECAUDIO,MSGL_V,"FAAD: Negotiated samplerate: %dHz  channels: %d\n", faac_samplerate, faac_channels);
     sh_audio->channels = faac_channels;
     sh_audio->samplerate = faac_samplerate;
-    sh_audio->i_bps = 128*1000/8; // XXX: HACK!!! There's currently no way to get bitrate from libfaad2! ::atmos
+    if(!sh_audio->i_bps) {
+      mp_msg(MSGT_DECAUDIO,MSGL_WARN,"FAAD: compressed input bitrate missing, assuming 128kbit/s!\n");
+      sh_audio->i_bps = 128*1000/8; // XXX: HACK!!! There's currently no way to get bitrate from libfaad2! ::atmos
+    } else 
+      mp_msg(MSGT_DECAUDIO,MSGL_V,"FAAD: got %dkbit/s rate from MP4 header!\n",sh_audio->i_bps*8/1000);
   }  
 	    
 } break;		




More information about the MPlayer-cvslog mailing list