diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-10 01:34:36 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-10 01:34:36 +0000 |
commit | 55b5ba458034ec090462b2f368074cd71aa28346 (patch) | |
tree | 2cde386a15770a6d00de8b2576c7a631d8180fb4 | |
parent | 58f834675f30e788ec676474a008f11aa8f6d4cc (diff) |
g72x support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3427 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | dec_audio.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dec_audio.c b/dec_audio.c index fa8bf3ed92..7c0a04d3e3 100644 --- a/dec_audio.c +++ b/dec_audio.c @@ -30,6 +30,8 @@ extern int verbose; // defined in mplayer.c 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 @@ case AFM_MPEG: // 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 @@ case AFM_ALAW: { 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; @@ -880,6 +896,13 @@ int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen){ 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: { unsigned char ibuf[IMA4_BLOCK_SIZE]; // bytes / frame if(demux_read_data(sh_audio->ds,ibuf,IMA4_BLOCK_SIZE)!=IMA4_BLOCK_SIZE) break; // EOF |