[Mplayer-cvslog] CVS: main dec_audio.c,1.56,1.57

Arpi of Ize arpi at mplayer.dev.hu
Mon Dec 10 02:34:39 CET 2001


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

Modified Files:
	dec_audio.c 
Log Message:
g72x support

Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_audio.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- dec_audio.c	9 Dec 2001 21:56:35 -0000	1.56
+++ dec_audio.c	10 Dec 2001 01:34:36 -0000	1.57
@@ -30,6 +30,8 @@
 static sample_t * a52_samples;
 static a52_state_t a52_state;
 
+#include "g72x/g72x.h"
+static G72x_DATA g72x_data;
 
 #include "alaw.h"
 
@@ -285,6 +287,13 @@
   // MPEG Audio:
   sh_audio->audio_out_minsize=4608;
   break;
+case AFM_G72X:
+//  g72x_reader_init(&g72x_data,G723_16_BITS_PER_SAMPLE);
+  g72x_reader_init(&g72x_data,G723_24_BITS_PER_SAMPLE);
+//  g72x_reader_init(&g72x_data,G721_32_BITS_PER_SAMPLE);
+//  g72x_reader_init(&g72x_data,G721_40_BITS_PER_SAMPLE);
+  sh_audio->audio_out_minsize=g72x_data.samplesperblock*4;
+  break;
 case AFM_FFMPEG:
 #ifndef USE_LIBAVCODEC
    mp_msg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_NoLAVCsupport);
@@ -436,6 +445,13 @@
   sh_audio->i_bps=sh_audio->channels*sh_audio->samplerate;
   break;
 }
+case AFM_G72X: {
+  // GSM 723 audio codec:
+  sh_audio->channels=sh_audio->wf->nChannels;
+  sh_audio->samplerate=sh_audio->wf->nSamplesPerSec;
+  sh_audio->i_bps=(sh_audio->samplerate/g72x_data.samplesperblock)*g72x_data.blocksize;
+  break;
+}
 #ifdef USE_LIBAVCODEC
 case AFM_FFMPEG: {
    int x;
@@ -878,6 +894,13 @@
         XA_MSGSM_Decoder(ibuf,(unsigned short *) buf); // decodes 65 byte -> 320 short
 //  	    XA_GSM_Decoder(buf,(unsigned short *) &sh_audio->a_buffer[sh_audio->a_buffer_len]); // decodes 33 byte -> 160 short
         len=2*320;
+        break;
+      }
+      case AFM_G72X:  // GSM 723 decoder
+      { if(demux_read_data(sh_audio->ds,g72x_data.block, g72x_data.blocksize)!=g72x_data.blocksize) break; // EOF
+        g72x_decode_block(&g72x_data);
+	len=2*g72x_data.samplesperblock;
+	memcpy(buf,g72x_data.samples,len);
         break;
       }
       case AFM_IMA4: // IMA-ADPCM 4:1 audio codec:




More information about the MPlayer-cvslog mailing list