# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_demux.h>
#include <vlc_codec.h>
#include <math.h>
vlc_module_begin();
set_shortname( "TTA" );
- set_description( _("TTA demuxer") );
+ set_description( N_("TTA demuxer") );
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_DEMUX );
- set_capability( "demux2", 145 );
+ set_capability( "demux", 145 );
set_callbacks( Open, Close );
add_shortcut( "tta" );
p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
if( !p_sys )
- return VLC_EGENERIC;
+ return VLC_ENOMEM;
/* Read the metadata */
es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'T', 'T', 'A', '1' ) );
if( !p_seektable )
{
free( p_sys );
- return VLC_EGENERIC;
+ return VLC_ENOMEM;
}
stream_Read( p_demux->s, p_seektable, i_seektable_size );
{
free( p_seektable );
free( p_sys );
- return VLC_EGENERIC;
+ return VLC_ENOMEM;
}
for( i = 0; i < p_sys->i_totalframes; i++ )
free( p_sys->pi_seektable );
free( p_seektable );
free( p_sys );
- return VLC_EGENERIC;
+ return VLC_ENOMEM;
}
memcpy( (uint8_t*)fmt.p_extra, p_header, 22 );
memcpy( (uint8_t*)fmt.p_extra+22, p_seektable, fmt.i_extra -22 );
p_data = stream_Block( p_demux->s, p_sys->pi_seektable[p_sys->i_currentframe] );
if( p_data == NULL ) return 0;
- p_data->i_dts = p_data->i_pts = (int64_t)(1 + I64C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME;
+ p_data->i_dts = p_data->i_pts = (int64_t)(1 + INT64_C(1000000) * p_sys->i_currentframe) * TTA_FRAMETIME;
p_sys->i_currentframe++;
case DEMUX_GET_LENGTH:
pi64 = (int64_t*)va_arg( args, int64_t * );
- *pi64 = I64C(1000000) * p_sys->i_totalframes * TTA_FRAMETIME;
+ *pi64 = INT64_C(1000000) * p_sys->i_totalframes * TTA_FRAMETIME;
return VLC_SUCCESS;
case DEMUX_GET_TIME:
pi64 = (int64_t*)va_arg( args, int64_t * );
- *pi64 = I64C(1000000) * p_sys->i_currentframe * TTA_FRAMETIME;
+ *pi64 = INT64_C(1000000) * p_sys->i_currentframe * TTA_FRAMETIME;
return VLC_SUCCESS;
default: