Commit ce3bb7a1 authored by Tristan Matthews's avatar Tristan Matthews

faad: update file, function and struct names

parent 4aa9e1ce
...@@ -2512,8 +2512,7 @@ AC_ARG_ENABLE(faad, ...@@ -2512,8 +2512,7 @@ AC_ARG_ENABLE(faad,
[ --enable-faad faad codec (default auto)]) [ --enable-faad faad codec (default auto)])
have_faad="no" have_faad="no"
AS_IF([test "${enable_faad}" != "no"], [ AS_IF([test "${enable_faad}" != "no"], [
AC_CHECK_HEADERS([faad.h], [ AC_CHECK_HEADERS([neaacdec.h], [
AC_CHECK_LIB(faad, faacDecOpen, [have_faad="yes"],, [$LIBM])
AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM]) AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
AS_IF([test "${have_faad}" = "yes"], [ AS_IF([test "${have_faad}" = "yes"], [
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_cpu.h> #include <vlc_cpu.h>
#include <faad.h> #include <neaacdec.h>
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -67,7 +67,7 @@ static void DoReordering( uint32_t *, uint32_t *, int, int, uint32_t * ); ...@@ -67,7 +67,7 @@ static void DoReordering( uint32_t *, uint32_t *, int, int, uint32_t * );
struct decoder_sys_t struct decoder_sys_t
{ {
/* faad handler */ /* faad handler */
faacDecHandle *hfaad; NeAACDecHandle *hfaad;
/* samples */ /* samples */
date_t date; date_t date;
...@@ -123,7 +123,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -123,7 +123,7 @@ static int Open( vlc_object_t *p_this )
{ {
decoder_t *p_dec = (decoder_t*)p_this; decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys; decoder_sys_t *p_sys;
faacDecConfiguration *cfg; NeAACDecConfiguration *cfg;
if( p_dec->fmt_in.i_codec != VLC_CODEC_MP4A ) if( p_dec->fmt_in.i_codec != VLC_CODEC_MP4A )
{ {
...@@ -135,7 +135,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -135,7 +135,7 @@ static int Open( vlc_object_t *p_this )
return VLC_ENOMEM; return VLC_ENOMEM;
/* Open a faad context */ /* Open a faad context */
if( ( p_sys->hfaad = faacDecOpen() ) == NULL ) if( ( p_sys->hfaad = NeAACDecOpen() ) == NULL )
{ {
msg_Err( p_dec, "cannot initialize faad" ); msg_Err( p_dec, "cannot initialize faad" );
free( p_sys ); free( p_sys );
...@@ -157,12 +157,12 @@ static int Open( vlc_object_t *p_this ) ...@@ -157,12 +157,12 @@ static int Open( vlc_object_t *p_this )
unsigned long i_rate; unsigned long i_rate;
unsigned char i_channels; unsigned char i_channels;
if( faacDecInit2( p_sys->hfaad, p_dec->fmt_in.p_extra, if( NeAACDecInit2( p_sys->hfaad, p_dec->fmt_in.p_extra,
p_dec->fmt_in.i_extra, p_dec->fmt_in.i_extra,
&i_rate, &i_channels ) < 0 ) &i_rate, &i_channels ) < 0 )
{ {
msg_Err( p_dec, "Failed to initialize faad using extra data" ); msg_Err( p_dec, "Failed to initialize faad using extra data" );
faacDecClose( p_sys->hfaad ); NeAACDecClose( p_sys->hfaad );
free( p_sys ); free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -182,11 +182,11 @@ static int Open( vlc_object_t *p_this ) ...@@ -182,11 +182,11 @@ static int Open( vlc_object_t *p_this )
} }
/* Set the faad config */ /* Set the faad config */
cfg = faacDecGetCurrentConfiguration( p_sys->hfaad ); cfg = NeAACDecGetCurrentConfiguration( p_sys->hfaad );
if( p_dec->fmt_in.audio.i_rate ) if( p_dec->fmt_in.audio.i_rate )
cfg->defSampleRate = p_dec->fmt_in.audio.i_rate; cfg->defSampleRate = p_dec->fmt_in.audio.i_rate;
cfg->outputFormat = HAVE_FPU ? FAAD_FMT_FLOAT : FAAD_FMT_16BIT; cfg->outputFormat = HAVE_FPU ? FAAD_FMT_FLOAT : FAAD_FMT_16BIT;
faacDecSetConfiguration( p_sys->hfaad, cfg ); NeAACDecSetConfiguration( p_sys->hfaad, cfg );
/* buffer */ /* buffer */
p_sys->i_buffer = p_sys->i_buffer_size = 0; p_sys->i_buffer = p_sys->i_buffer_size = 0;
...@@ -266,9 +266,9 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -266,9 +266,9 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
unsigned long i_rate; unsigned long i_rate;
unsigned char i_channels; unsigned char i_channels;
if( faacDecInit2( p_sys->hfaad, p_dec->fmt_in.p_extra, if( NeAACDecInit2( p_sys->hfaad, p_dec->fmt_in.p_extra,
p_dec->fmt_in.i_extra, p_dec->fmt_in.i_extra,
&i_rate, &i_channels ) >= 0 ) &i_rate, &i_channels ) >= 0 )
{ {
p_dec->fmt_out.audio.i_rate = i_rate; p_dec->fmt_out.audio.i_rate = i_rate;
p_dec->fmt_out.audio.i_channels = i_channels; p_dec->fmt_out.audio.i_channels = i_channels;
...@@ -286,9 +286,9 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -286,9 +286,9 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
unsigned char i_channels; unsigned char i_channels;
/* Init faad with the first frame */ /* Init faad with the first frame */
if( faacDecInit( p_sys->hfaad, if( NeAACDecInit( p_sys->hfaad,
p_sys->p_buffer, p_sys->i_buffer, p_sys->p_buffer, p_sys->i_buffer,
&i_rate, &i_channels ) < 0 ) &i_rate, &i_channels ) < 0 )
{ {
block_Release( p_block ); block_Release( p_block );
return NULL; return NULL;
...@@ -318,15 +318,15 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -318,15 +318,15 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( p_sys->i_buffer > 1) if( p_sys->i_buffer > 1)
{ {
void *samples; void *samples;
faacDecFrameInfo frame; NeAACDecFrameInfo frame;
block_t *p_out; block_t *p_out;
samples = faacDecDecode( p_sys->hfaad, &frame, samples = NeAACDecDecode( p_sys->hfaad, &frame,
p_sys->p_buffer, p_sys->i_buffer ); p_sys->p_buffer, p_sys->i_buffer );
if( frame.error > 0 ) if( frame.error > 0 )
{ {
msg_Warn( p_dec, "%s", faacDecGetErrorMessage( frame.error ) ); msg_Warn( p_dec, "%s", NeAACDecGetErrorMessage( frame.error ) );
if( frame.error == 21 || frame.error == 12 ) if( frame.error == 21 || frame.error == 12 )
{ {
...@@ -338,28 +338,28 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -338,28 +338,28 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
*/ */
unsigned long i_rate; unsigned long i_rate;
unsigned char i_channels; unsigned char i_channels;
faacDecHandle *hfaad; NeAACDecHandle *hfaad;
faacDecConfiguration *cfg,*oldcfg; NeAACDecConfiguration *cfg,*oldcfg;
oldcfg = faacDecGetCurrentConfiguration( p_sys->hfaad ); oldcfg = NeAACDecGetCurrentConfiguration( p_sys->hfaad );
hfaad = faacDecOpen(); hfaad = NeAACDecOpen();
cfg = faacDecGetCurrentConfiguration( hfaad ); cfg = NeAACDecGetCurrentConfiguration( hfaad );
if( oldcfg->defSampleRate ) if( oldcfg->defSampleRate )
cfg->defSampleRate = oldcfg->defSampleRate; cfg->defSampleRate = oldcfg->defSampleRate;
cfg->defObjectType = oldcfg->defObjectType; cfg->defObjectType = oldcfg->defObjectType;
cfg->outputFormat = oldcfg->outputFormat; cfg->outputFormat = oldcfg->outputFormat;
faacDecSetConfiguration( hfaad, cfg ); NeAACDecSetConfiguration( hfaad, cfg );
if( faacDecInit( hfaad, p_sys->p_buffer, p_sys->i_buffer, if( NeAACDecInit( hfaad, p_sys->p_buffer, p_sys->i_buffer,
&i_rate,&i_channels ) < 0 ) &i_rate,&i_channels ) < 0 )
{ {
/* reinitialization failed */ /* reinitialization failed */
faacDecClose( hfaad ); NeAACDecClose( hfaad );
faacDecSetConfiguration( p_sys->hfaad, oldcfg ); NeAACDecSetConfiguration( p_sys->hfaad, oldcfg );
} }
else else
{ {
faacDecClose( p_sys->hfaad ); NeAACDecClose( p_sys->hfaad );
p_sys->hfaad = hfaad; p_sys->hfaad = hfaad;
p_dec->fmt_out.audio.i_rate = i_rate; p_dec->fmt_out.audio.i_rate = i_rate;
p_dec->fmt_out.audio.i_channels = i_channels; p_dec->fmt_out.audio.i_channels = i_channels;
...@@ -522,7 +522,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -522,7 +522,7 @@ static void Close( vlc_object_t *p_this )
decoder_t *p_dec = (decoder_t *)p_this; decoder_t *p_dec = (decoder_t *)p_this;
decoder_sys_t *p_sys = p_dec->p_sys; decoder_sys_t *p_sys = p_dec->p_sys;
faacDecClose( p_sys->hfaad ); NeAACDecClose( p_sys->hfaad );
free( p_sys->p_buffer ); free( p_sys->p_buffer );
free( p_sys ); free( p_sys );
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment