- es_format_t fmt;
- real_track_t *tk;
- uint8_t *p_peek;
-
- msg_Dbg( p_demux, " - specific data len=%d", i_len );
- if( stream_Peek( p_demux->s, &p_peek, 34 ) >= 34 )
- {
- if( !strncmp( &p_peek[4], "VIDO", 4 ) )
- {
- es_format_Init( &fmt, VIDEO_ES,
- VLC_FOURCC( p_peek[8], p_peek[9], p_peek[10], p_peek[11] ) );
- fmt.video.i_width = GetWBE( &p_peek[12] );
- fmt.video.i_height= GetWBE( &p_peek[14] );
-
- fmt.i_extra = 8;
- fmt.p_extra = malloc( 8 );
- ((uint32_t*)fmt.p_extra)[0] = GetDWBE( &p_peek[26] );
- ((uint32_t*)fmt.p_extra)[1] = GetDWBE( &p_peek[30] );
-
- msg_Dbg( p_demux, " - video 0x%08x 0x%08x",
- ((uint32_t*)fmt.p_extra)[0],
- ((uint32_t*)fmt.p_extra)[1] );
-
- if( GetDWBE( &p_peek[30] ) == 0x10003000 ||
- GetDWBE( &p_peek[30] ) == 0x10003001 )
- {
- fmt.i_codec = VLC_FOURCC( 'R','V','1','3' );
- }
-
- msg_Dbg( p_demux, " - video %4.4s %dx%d",
- (char*)&fmt.i_codec,
- fmt.video.i_width, fmt.video.i_height );
-
- tk = malloc( sizeof( real_track_t ) );
- tk->i_id = i_num;
- tk->fmt = fmt;
- tk->i_frame = 0;
- tk->p_frame = NULL;
- tk->p_es = es_out_Add( p_demux->out, &fmt );
-
- TAB_APPEND( p_sys->i_track, p_sys->track, tk );
- }
- else if( !strncmp( p_peek, ".ra\xfd", 4 ) )
- {
- int i_version = GetWBE( &p_peek[4] );
- uint8_t *p_extra = NULL;
- msg_Dbg( p_demux, " - audio version=%d", i_version );
-
- es_format_Init( &fmt, AUDIO_ES, 0 );
- if( i_version == 4 && stream_Peek( p_demux->s, &p_peek, 56 ) >= 56 )
- {
- fmt.audio.i_channels = GetWBE( &p_peek[54] );
- fmt.audio.i_rate = GetWBE( &p_peek[48] );
-
- if( stream_Peek( p_demux->s, &p_peek, 57 ) >= 57 )
- {
- int i_extra = p_peek[56] + 1 + 4;
- if( stream_Peek( p_demux->s, &p_peek, 57 + i_extra ) >= 57 + i_extra )
- {
- memcpy( &fmt.i_codec, &p_peek[57 + p_peek[56] + 1], 4 );
- }
- p_extra = &p_peek[57 + p_peek[56] + 1+ 4 + 3];
- }
- }
- else if( i_version == 5 && stream_Peek( p_demux->s, &p_peek, 70 ) >= 70 )
- {
- memcpy( &fmt.i_codec, &p_peek[66], 4 );
- fmt.audio.i_channels = GetWBE( &p_peek[60] );
- fmt.audio.i_rate = GetWBE( &p_peek[54] );
-
- p_extra = &p_peek[66+4+3+1];
- }
- msg_Dbg( p_demux, " - audio codec=%4.4s channels=%d rate=%dHz",
- (char*)&fmt.i_codec,
- fmt.audio.i_channels, fmt.audio.i_rate );
-
- if( fmt.i_codec == VLC_FOURCC( 'd', 'n', 'e', 't' ) )
- {
- fmt.i_codec = VLC_FOURCC( 'a', '5', '2', ' ' );
- }
- else if( fmt.i_codec == VLC_FOURCC( 'r', 'a', 'a', 'c' ) ||
- fmt.i_codec == VLC_FOURCC( 'r', 'a', 'c', 'p' ) )
- {
- int i_peek = p_extra - p_peek;
- if( stream_Peek( p_demux->s, &p_peek, i_peek + 4 ) >= i_peek + 4 )
- {
- int i_extra = GetDWBE( &p_peek[i_peek] );
-
- if( i_extra > 1 && i_peek + 4 + i_extra <= i_len &&
- stream_Peek( p_demux->s, &p_peek, i_peek + 4 + i_extra ) >= i_peek + 4 + i_extra )
- {
- fmt.i_extra = i_extra - 1;
- fmt.p_extra = malloc ( i_extra - 1 );
- memcpy( fmt.p_extra, &p_peek[i_peek+4+1], i_extra - 1 );
-
- msg_Dbg( p_demux, " - extra data=%d", i_extra );
- {
- int i;
- for( i = 0; i < fmt.i_extra; i++ )
- {
- msg_Dbg( p_demux, " data[%d] = 0x%x", i,((uint8_t*)fmt.p_extra)[i] );
- }
- }
- }
- }
- fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'a' );
- }
-
- if( fmt.i_codec != 0 )
- {
- tk = malloc( sizeof( real_track_t ) );
- tk->i_id = i_num;
- tk->fmt = fmt;
- tk->i_frame = 0;
- tk->p_frame = NULL;
- tk->p_es = es_out_Add( p_demux->out, &fmt );
-
- TAB_APPEND( p_sys->i_track, p_sys->track, tk );
- }
- }
- }