# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_aout.h>
#include <vlc_block_helper.h>
struct decoder_sys_t
{
/* Module mode */
- vlc_bool_t b_packetizer;
+ bool b_packetizer;
/*
* Input properties
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-vlc_module_begin();
- set_description( _("DTS parser") );
- set_capability( "decoder", 100 );
- set_callbacks( OpenDecoder, CloseDecoder );
+vlc_module_begin ()
+ set_description( N_("DTS parser") )
+ set_capability( "decoder", 100 )
+ set_callbacks( OpenDecoder, CloseDecoder )
- add_submodule();
- set_description( _("DTS audio packetizer") );
- set_capability( "packetizer", 10 );
- set_callbacks( OpenPacketizer, CloseDecoder );
-vlc_module_end();
+ add_submodule ()
+ set_description( N_("DTS audio packetizer") )
+ set_capability( "packetizer", 10 )
+ set_callbacks( OpenPacketizer, CloseDecoder )
+vlc_module_end ()
/*****************************************************************************
* OpenDecoder: probe the decoder and return score
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Misc init */
- p_sys->b_packetizer = VLC_FALSE;
+ p_sys->b_packetizer = false;
p_sys->i_state = STATE_NOSYNC;
aout_DateSet( &p_sys->end_date, 0 );
- p_sys->bytestream = block_BytestreamInit( p_dec );
+ p_sys->bytestream = block_BytestreamInit();
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
int i_ret = OpenDecoder( p_this );
- if( i_ret == VLC_SUCCESS ) p_dec->p_sys->b_packetizer = VLC_TRUE;
+ if( i_ret == VLC_SUCCESS ) p_dec->p_sys->b_packetizer = true;
return i_ret;
}
p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream );
}
-// aout_DateSet( &p_sys->end_date, 0 );
+ aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block );
return NULL;
}
case STATE_SEND_DATA:
if( !(p_buf = GetOutBuffer( p_dec, &p_out_buffer )) )
{
- //p_dec->b_error = VLC_TRUE;
+ //p_dec->b_error = true;
return NULL;
}
/* Hack for DTS S/PDIF filter which needs to send 3 frames at a time
* (plus a few header bytes) */
- p_buf = p_dec->pf_aout_buffer_new( p_dec, p_sys->i_frame_length * 4 );
+ p_buf = decoder_NewAudioBuffer( p_dec, p_sys->i_frame_length * 4 );
if( p_buf == NULL ) return NULL;
p_buf->i_nb_samples = p_sys->i_frame_length;
p_buf->i_nb_bytes = p_sys->i_frame_size;