[Mplayer-cvslog] CVS: main/libmpcodecs ad_faad.c,1.8,1.9

Arpi of Ize arpi at mplayerhq.hu
Fri Feb 7 22:04:38 CET 2003


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv30624/libmpcodecs

Modified Files:
	ad_faad.c 
Log Message:
libfaad2 v1.0, v1.1, v1.2 detection, and API change workaround in ad_faad.c
based on patch by Andre Schulz <andre at 0wnage.de>


Index: ad_faad.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_faad.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ad_faad.c	7 Oct 2002 10:18:46 -0000	1.8
+++ ad_faad.c	7 Feb 2003 21:04:35 -0000	1.9
@@ -85,8 +85,13 @@
     sh->a_in_buffer_len = demux_read_data(sh->ds, sh->a_in_buffer, sh->a_in_buffer_size);
 
     /* init the codec */
+#if (FAADVERSION <= 11)
     faac_init = faacDecInit(faac_hdec, sh->a_in_buffer,
        &faac_samplerate, &faac_channels);
+#else
+    faac_init = faacDecInit(faac_hdec, sh->a_in_buffer,
+       sh->a_in_buffer_len, &faac_samplerate, &faac_channels);
+#endif
 
     sh->a_in_buffer_len -= (faac_init > 0)?faac_init:0; // how many bytes init consumed
     // XXX FIXME: shouldn't we memcpy() here in a_in_buffer ?? --A'rpi
@@ -164,7 +169,12 @@
   if(!sh->codecdata_len){
    // raw aac stream:
    do {
+#if (FAADVERSION <= 11)
     faac_sample_buffer = faacDecDecode(faac_hdec, &faac_finfo, sh->a_in_buffer+j);
+#else
+    faac_sample_buffer = faacDecDecode(faac_hdec, &faac_finfo, sh->a_in_buffer+j, sh->a_in_buffer_len);
+#endif
+	
     /* update buffer index after faacDecDecode */
     if(faac_finfo.bytesconsumed >= sh->a_in_buffer_len) {
       sh->a_in_buffer_len=0;
@@ -184,7 +194,11 @@
     unsigned char* bufptr=NULL;
     int buflen=ds_get_packet(sh->ds, &bufptr);
     if(buflen<=0) break;
+#if (FAADVERSION <= 11)
     faac_sample_buffer = faacDecDecode(faac_hdec, &faac_finfo, bufptr);
+#else
+    faac_sample_buffer = faacDecDecode(faac_hdec, &faac_finfo, bufptr, buflen);
+#endif
 //    printf("FAAC decoded %d of %d  (err: %d)  \n",faac_finfo.bytesconsumed,buflen,faac_finfo.error);
   }
   



More information about the MPlayer-cvslog mailing list