Commit 302020cc authored by Jean-Paul Saman's avatar Jean-Paul Saman

Adapted mad codec plugin to new aout3. Not tested yet.`

Plugin is not being build by new built structure, this needs to be fixed first.
parent d1aefb4d
......@@ -142,11 +142,17 @@ static int InitThread( mad_adec_thread_t * p_mad_adec )
decoder_fifo_t * p_fifo = p_mad_adec->p_fifo;
char *psz_downscale = NULL;
/* Initialize the thread properties */
p_mad_adec->p_aout = NULL;
p_mad_adec->p_aout_input = NULL;
p_mad_adec->output_format.i_format = AOUT_FMT_FIXED32;
p_mad_adec->output_format.i_channels = 2; /* FIXME ! */
/*
* Properties of audio for libmad
*/
/* Look what scaling method was requested by the user */
/* Look what scaling method was requested by the user */
psz_downscale = config_GetPsz( p_fifo, "downscale" );
if ( strncmp(psz_downscale,"fast",4)==0 )
......@@ -165,7 +171,7 @@ static int InitThread( mad_adec_thread_t * p_mad_adec )
msg_Dbg( p_fifo, "downscale default fast selected" );
}
if (psz_downscale) free(psz_downscale);
if (psz_downscale) free(psz_downscale);
/* Initialize the libmad decoder structures */
p_mad_adec->libmad_decoder = (struct mad_decoder*) malloc(sizeof(struct mad_decoder));
......@@ -177,21 +183,15 @@ static int InitThread( mad_adec_thread_t * p_mad_adec )
p_mad_adec->i_current_pts = p_mad_adec->i_next_pts = 0;
mad_decoder_init( p_mad_adec->libmad_decoder,
p_mad_adec, /* vlc's thread structure and p_fifo playbuffer */
libmad_input, /* input_func */
p_mad_adec, /* vlc's thread structure and p_fifo playbuffer */
libmad_input, /* input_func */
0, /* header_func */
0, /* filter */
libmad_output, /* output_func */
0, /* error */
0); /* message */
libmad_output3, /* output_func */
0, /* error */
0); /* message */
mad_decoder_options(p_mad_adec->libmad_decoder, MAD_OPTION_IGNORECRC);
// mad_timer_reset(&p_mad_adec->libmad_timer);
/*
* Initialize the output properties
*/
p_mad_adec->p_aout_fifo = NULL;
/*
* Initialize the input properties
......@@ -221,7 +221,7 @@ static void EndThread (mad_adec_thread_t * p_mad_adec)
/* If the audio output fifo was created, we destroy it */
if (p_mad_adec->p_aout_fifo != NULL)
{
aout_DestroyFifo (p_mad_adec->p_aout_fifo);
aout_InputDelete( p_mad_adec->p_aout, p_mad_adec->p_aout_input );
/* Make sure the output thread leaves the NextFrame() function */
vlc_mutex_lock (&(p_mad_adec->p_aout_fifo->data_lock));
......
......@@ -50,8 +50,17 @@ typedef struct mad_adec_thread_s
/*
* Output properties
*/
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
enum mad_scaling audio_scaling;
//old way aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
/*
* Output properties
*/
aout_instance_t * p_aout; /* opaque */
aout_input_t * p_aout_input; /* opaque */
audio_sample_format_t output_format;
mtime_t last_date;
enum mad_scaling audio_scaling;
} mad_adec_thread_t;
......
This diff is collapsed.
......@@ -40,7 +40,8 @@ enum mad_flow libmad_header(void *data, struct mad_header const *p_libmad_header
// enum mad_flow libmad_filter(void *data, struct mad_stream const *p_libmad_stream, struct mad_frame *p_libmad_frame);
/* enum mad_flow (*output_func)(void *, struct mad_header const *, struct mad_pcm *); */
enum mad_flow libmad_output(void *data, struct mad_header const *p_libmad_header, struct mad_pcm *p_libmad_pcm);
//enum mad_flow libmad_output(void *data, struct mad_header const *p_libmad_header, struct mad_pcm *p_libmad_pcm);
enum mad_flow libmad_output3(void *data, struct mad_header const *p_libmad_header, struct mad_pcm *p_libmad_pcm);
/* enum mad_flow (*error_func)(void *, struct mad_stream *, struct mad_frame *); */
enum mad_flow libmad_error(void *data, struct mad_stream *p_libmad_stream, struct mad_frame *p_libmad_frame);
......
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