X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Ftta.c;h=41ab605cdcd8842d4334bb6a1123d1b953586393;hb=6975cd69d30a528950fcc4458397a20c4f23888c;hp=e9c686637506651fd5a0f3d23776ff28283a6761;hpb=f64ef866545064f3e5901e9b5a3b3f97a2516dd9;p=vlc diff --git a/modules/demux/tta.c b/modules/demux/tta.c index e9c6866375..41ab605cdc 100644 --- a/modules/demux/tta.c +++ b/modules/demux/tta.c @@ -24,6 +24,10 @@ /***************************************************************************** * Preamble *****************************************************************************/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include @@ -79,7 +83,7 @@ static int Open( vlc_object_t * p_this ) demux_t *p_demux = (demux_t*)p_this; demux_sys_t *p_sys; es_format_t fmt; - uint8_t *p_peek; + const uint8_t *p_peek; uint8_t p_header[22]; uint8_t *p_seektable; int i_seektable_size = 0, i; @@ -105,7 +109,7 @@ static int Open( vlc_object_t * p_this ) p_demux->pf_demux = Demux; p_demux->pf_control = Control; p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); - + /* Read the metadata */ es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'T', 'T', 'A', '1' ) ); fmt.audio.i_channels = GetWLE( &p_header[6] ); @@ -115,7 +119,7 @@ static int Open( vlc_object_t * p_this ) p_sys->i_datalength = GetDWLE( &p_header[14] ); p_sys->i_framelength = TTA_FRAMETIME * fmt.audio.i_rate; - p_sys->i_totalframes = p_sys->i_datalength / p_sys->i_framelength + + p_sys->i_totalframes = p_sys->i_datalength / p_sys->i_framelength + ((p_sys->i_datalength % p_sys->i_framelength) ? 1 : 0); p_sys->i_currentframe = 0; @@ -138,19 +142,7 @@ static int Open( vlc_object_t * p_this ) p_sys->p_es = es_out_Add( p_demux->out, &fmt ); free( p_seektable ); p_sys->i_start = stream_Tell( p_demux->s ); - -#if 0 - /* Parse possible id3 header */ - if( ( p_id3 = module_Need( p_demux, "meta reader", NULL, 0 ) ) ) - { - p_sys->p_meta = (vlc_meta_t *)p_demux->p_private; - p_demux->p_private = NULL; - module_Unneed( p_demux, p_id3 ); - } - if( !p_sys->p_meta ) - p_sys->p_meta = vlc_meta_New(); -#endif return VLC_SUCCESS; } @@ -231,7 +223,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) return VLC_SUCCESS; } return VLC_EGENERIC; - + case DEMUX_GET_LENGTH: pi64 = (int64_t*)va_arg( args, int64_t * ); *pi64 = I64C(1000000) * p_sys->i_totalframes * TTA_FRAMETIME; @@ -241,7 +233,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) pi64 = (int64_t*)va_arg( args, int64_t * ); *pi64 = I64C(1000000) * p_sys->i_currentframe * TTA_FRAMETIME; return VLC_SUCCESS; - + default: return VLC_EGENERIC; }