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,6 +142,12 @@ static int InitThread( mad_adec_thread_t * p_mad_adec ) ...@@ -142,6 +142,12 @@ static int InitThread( mad_adec_thread_t * p_mad_adec )
decoder_fifo_t * p_fifo = p_mad_adec->p_fifo; decoder_fifo_t * p_fifo = p_mad_adec->p_fifo;
char *psz_downscale = NULL; 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 * Properties of audio for libmad
*/ */
...@@ -181,17 +187,11 @@ static int InitThread( mad_adec_thread_t * p_mad_adec ) ...@@ -181,17 +187,11 @@ static int InitThread( mad_adec_thread_t * p_mad_adec )
libmad_input, /* input_func */ libmad_input, /* input_func */
0, /* header_func */ 0, /* header_func */
0, /* filter */ 0, /* filter */
libmad_output, /* output_func */ libmad_output3, /* output_func */
0, /* error */ 0, /* error */
0); /* message */ 0); /* message */
mad_decoder_options(p_mad_adec->libmad_decoder, MAD_OPTION_IGNORECRC); 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 * Initialize the input properties
...@@ -221,7 +221,7 @@ static void EndThread (mad_adec_thread_t * p_mad_adec) ...@@ -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 the audio output fifo was created, we destroy it */
if (p_mad_adec->p_aout_fifo != NULL) 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 */ /* Make sure the output thread leaves the NextFrame() function */
vlc_mutex_lock (&(p_mad_adec->p_aout_fifo->data_lock)); vlc_mutex_lock (&(p_mad_adec->p_aout_fifo->data_lock));
......
...@@ -50,7 +50,16 @@ typedef struct mad_adec_thread_s ...@@ -50,7 +50,16 @@ typedef struct mad_adec_thread_s
/* /*
* Output properties * Output properties
*/ */
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */ //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; enum mad_scaling audio_scaling;
} mad_adec_thread_t; } 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 ...@@ -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 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 (*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 (*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); 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