- fmt.i_extra = 22 + (p_sys->i_totalframes * 4) + 4;
- fmt.p_extra = malloc( fmt.i_extra );
- memcpy( (uint8_t*)fmt.p_extra, p_header, 22 );
- memcpy( (uint8_t*)fmt.p_extra+22, p_seektable, fmt.i_extra -22 );
-
- 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 */
- p_demux->p_private = malloc( sizeof( demux_meta_t ) );
- if( !p_demux->p_private )
- return VLC_ENOMEM;
- if( ( p_id3 = module_Need( p_demux, "meta reader", NULL, 0 ) ) )
+ fmt.i_extra = 22 + i_seektable_size + 4;
+ fmt.p_extra = p_fullheader = malloc( fmt.i_extra );
+ if( !p_fullheader )
+ goto error;
+
+ memcpy( p_fullheader, p_header, 22 );
+ p_fullheader += 22;
+ if( stream_Read( p_demux->s, p_fullheader, i_seektable_size )
+ != i_seektable_size )
+ goto error;
+
+ p_sys->pi_seektable = calloc( p_sys->i_totalframes, sizeof(uint32_t) );
+ if( !p_sys->pi_seektable )
+ goto error;
+ for( uint32_t i = 0; i < p_sys->i_totalframes; i++ )