Commit 63227deb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove ugly function casts in combined audio decoder/packetizer modules

parent 0dfcbe01
......@@ -98,7 +98,7 @@ enum {
/****************************************************************************
* Local prototypes
****************************************************************************/
static void *DecodeBlock ( decoder_t *, block_t ** );
static block_t *DecodeBlock ( decoder_t *, block_t ** );
static uint8_t *GetOutBuffer ( decoder_t *, block_t ** );
static aout_buffer_t *GetAoutBuffer( decoder_t * );
......@@ -150,11 +150,9 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
/* Set callback */
if( b_packetizer )
p_dec->pf_packetize = (block_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_packetize = DecodeBlock;
else
p_dec->pf_decode_audio = (aout_buffer_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_decode_audio = DecodeBlock;
return VLC_SUCCESS;
}
......@@ -176,7 +174,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
****************************************************************************
* This function is called just after the thread is launched.
****************************************************************************/
static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
uint8_t p_header[VLC_A52_HEADER_SIZE];
......
......@@ -105,7 +105,7 @@ enum {
* Local prototypes
****************************************************************************/
static int OpenCommon( vlc_object_t *, bool b_packetizer );
static void *DecodeBlock( decoder_t *, block_t ** );
static block_t *DecodeBlock( decoder_t *, block_t ** );
static inline int SyncCode( const uint8_t * );
static int SyncInfo( const uint8_t *, bool *, unsigned int *, unsigned int *,
......@@ -165,10 +165,8 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
p_dec->fmt_out.audio.i_rate = 0; /* So end_date gets initialized */
/* Set callback */
p_dec->pf_decode_audio = (aout_buffer_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_packetize = (block_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_decode_audio = DecodeBlock;
p_dec->pf_packetize = DecodeBlock;
return VLC_SUCCESS;
}
......@@ -176,7 +174,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
/****************************************************************************
* DecodeBlock: the whole thing
****************************************************************************/
static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
uint8_t p_header[DTS_HEADER_SIZE];
......
......@@ -162,7 +162,7 @@ typedef struct
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static void *DecodeFrame ( decoder_t *, block_t ** );
static block_t *DecodeFrame ( decoder_t *, block_t ** );
/* */
static int VobHeader( unsigned *pi_rate,
......@@ -266,10 +266,8 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
}
/* Set callback */
p_dec->pf_decode_audio = (aout_buffer_t *(*)(decoder_t *, block_t **))
DecodeFrame;
p_dec->pf_packetize = (block_t *(*)(decoder_t *, block_t **))
DecodeFrame;
p_dec->pf_decode_audio = DecodeFrame;
p_dec->pf_packetize = DecodeFrame;
return VLC_SUCCESS;
}
......@@ -287,7 +285,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
****************************************************************************
* Beware, this function must be fed with complete frames (PES packet).
*****************************************************************************/
static void *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
static block_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
block_t *p_block;
......
......@@ -95,7 +95,7 @@ enum {
static int OpenDecoder ( vlc_object_t * );
static int OpenPacketizer( vlc_object_t * );
static void CloseDecoder ( vlc_object_t * );
static void *DecodeBlock ( decoder_t *, block_t ** );
static block_t *DecodeBlock ( decoder_t *, block_t ** );
static uint8_t *GetOutBuffer ( decoder_t *, block_t ** );
static aout_buffer_t *GetAoutBuffer( decoder_t * );
......@@ -160,10 +160,8 @@ static int Open( vlc_object_t *p_this )
p_dec->fmt_out.audio.i_rate = 0; /* So end_date gets initialized */
/* Set callback */
p_dec->pf_decode_audio = (aout_buffer_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_packetize = (block_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_decode_audio = DecodeBlock;
p_dec->pf_packetize = DecodeBlock;
/* Start with the minimum size for a free bitrate frame */
p_sys->i_free_frame_size = MPGA_HEADER_SIZE;
......@@ -196,7 +194,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
****************************************************************************
* This function is called just after the thread is launched.
****************************************************************************/
static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
uint8_t p_header[MAD_BUFFER_GUARD];
......
......@@ -185,7 +185,7 @@ static const int pi_channels_maps[6] =
* Local prototypes
****************************************************************************/
static void *DecodeBlock ( decoder_t *, block_t ** );
static block_t *DecodeBlock ( decoder_t *, block_t ** );
static aout_buffer_t *DecodeRtpSpeexPacket( decoder_t *, block_t **);
static int ProcessHeaders( decoder_t * );
static int ProcessInitialHeader ( decoder_t *, ogg_packet * );
......@@ -233,16 +233,13 @@ static int OpenDecoder( vlc_object_t *p_this )
{
msg_Dbg( p_dec, "Using RTP version of Speex decoder @ rate %d.",
p_dec->fmt_in.audio.i_rate );
p_dec->pf_decode_audio = (aout_buffer_t *(*)(decoder_t *, block_t **))
DecodeRtpSpeexPacket;
p_dec->pf_decode_audio = DecodeRtpSpeexPacket;
}
else
{
p_dec->pf_decode_audio = (aout_buffer_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_decode_audio = DecodeBlock;
}
p_dec->pf_packetize = (block_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_packetize = DecodeBlock;
p_sys->p_state = NULL;
p_sys->p_header = NULL;
......@@ -271,7 +268,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
****************************************************************************
* This function must be fed with ogg packets.
****************************************************************************/
static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
ogg_packet oggpacket;
......
......@@ -141,7 +141,7 @@ static const uint32_t pi_3channels_in[] =
static int OpenDecoder ( vlc_object_t * );
static int OpenPacketizer( vlc_object_t * );
static void CloseDecoder ( vlc_object_t * );
static void *DecodeBlock ( decoder_t *, block_t ** );
static block_t *DecodeBlock ( decoder_t *, block_t ** );
static int ProcessHeaders( decoder_t * );
static void *ProcessPacket ( decoder_t *, ogg_packet *, block_t ** );
......@@ -261,10 +261,8 @@ static int OpenDecoder( vlc_object_t *p_this )
#endif
/* Set callbacks */
p_dec->pf_decode_audio = (aout_buffer_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_packetize = (block_t *(*)(decoder_t *, block_t **))
DecodeBlock;
p_dec->pf_decode_audio = DecodeBlock;
p_dec->pf_packetize = DecodeBlock;
return VLC_SUCCESS;
}
......@@ -289,7 +287,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
****************************************************************************
* This function must be fed with ogg packets.
****************************************************************************/
static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
ogg_packet oggpacket;
......
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