mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 04:44:32 +01:00
g72x support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3427 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
58f834675f
commit
55b5ba4580
23
dec_audio.c
23
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user