Commit 9ce49710 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Remove dead code (and commented out fprintf's).

parent 54b9a46e
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "asf.h" #include "asf.h"
#include "buffer.h" #include "buffer.h"
static int CmpGuid( const guid_t *p_guid1, const guid_t *p_guid2 ) static int CmpGuid( const guid_t *p_guid1, const guid_t *p_guid2 )
{ {
return( ( p_guid1->v1 == p_guid2->v1 && return( ( p_guid1->v1 == p_guid2->v1 &&
...@@ -76,31 +75,20 @@ void E_( asf_HeaderParse )( asf_header_t *hdr, ...@@ -76,31 +75,20 @@ void E_( asf_HeaderParse )( asf_header_t *hdr,
hdr->stream[i].i_bitrate = -1; hdr->stream[i].i_bitrate = -1;
} }
//fprintf( stderr, " ---------------------header:%d\n", i_header );
var_buffer_initread( &buffer, p_header, i_header ); var_buffer_initread( &buffer, p_header, i_header );
var_buffer_getguid( &buffer, &guid ); var_buffer_getguid( &buffer, &guid );
if( !CmpGuid( &guid, &asf_object_header_guid ) ) if( !CmpGuid( &guid, &asf_object_header_guid ) )
{ {
// XXX Error /* ERROR: */
// fprintf( stderr, " ---------------------ERROR------\n" );
} }
var_buffer_getmemory( &buffer, NULL, 30 - 16 ); var_buffer_getmemory( &buffer, NULL, 30 - 16 );
for( ;; ) for( ;; )
{ {
//fprintf( stderr, " ---------------------data:%d\n", buffer.i_data );
var_buffer_getguid( &buffer, &guid ); var_buffer_getguid( &buffer, &guid );
i_size = var_buffer_get64( &buffer ); i_size = var_buffer_get64( &buffer );
//fprintf( stderr, " guid=0x%8.8x-0x%4.4x-0x%4.4x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x size=%lld\n",
// guid.v1,guid.v2, guid.v3,
// guid.v4[0],guid.v4[1],guid.v4[2],guid.v4[3],
// guid.v4[4],guid.v4[5],guid.v4[6],guid.v4[7],
// i_size );
if( CmpGuid( &guid, &asf_object_file_properties_guid ) ) if( CmpGuid( &guid, &asf_object_file_properties_guid ) )
{ {
var_buffer_getmemory( &buffer, NULL, 16 ); var_buffer_getmemory( &buffer, NULL, 16 );
...@@ -124,8 +112,6 @@ void E_( asf_HeaderParse )( asf_header_t *hdr, ...@@ -124,8 +112,6 @@ void E_( asf_HeaderParse )( asf_header_t *hdr,
int i_subsize; int i_subsize;
int i; int i;
//fprintf( stderr, "extended stream properties\n" );
var_buffer_getmemory( &buffer, NULL, 84 - 24 ); var_buffer_getmemory( &buffer, NULL, 84 - 24 );
i_count1 = var_buffer_get16( &buffer ); i_count1 = var_buffer_get16( &buffer );
...@@ -153,9 +139,6 @@ void E_( asf_HeaderParse )( asf_header_t *hdr, ...@@ -153,9 +139,6 @@ void E_( asf_HeaderParse )( asf_header_t *hdr,
i_subsize += 16 + 6 + i_len; i_subsize += 16 + 6 + i_len;
} }
//fprintf( stderr, "extended stream properties left=%d\n",
// i_size - i_subsize );
if( i_size - i_subsize <= 24 ) if( i_size - i_subsize <= 24 )
{ {
var_buffer_getmemory( &buffer, NULL, i_size - i_subsize ); var_buffer_getmemory( &buffer, NULL, i_size - i_subsize );
...@@ -168,23 +151,18 @@ void E_( asf_HeaderParse )( asf_header_t *hdr, ...@@ -168,23 +151,18 @@ void E_( asf_HeaderParse )( asf_header_t *hdr,
int i_stream_id; int i_stream_id;
guid_t stream_type; guid_t stream_type;
//fprintf( stderr, "stream properties\n" );
var_buffer_getguid( &buffer, &stream_type ); var_buffer_getguid( &buffer, &stream_type );
var_buffer_getmemory( &buffer, NULL, 32 ); var_buffer_getmemory( &buffer, NULL, 32 );
i_stream_id = var_buffer_get8( &buffer ) & 0x7f;
//fprintf( stderr, " 1---------------------skip:%lld\n", i_size - 24 - 32 - 16 - 1 ); i_stream_id = var_buffer_get8( &buffer ) & 0x7f;
var_buffer_getmemory( &buffer, NULL, i_size - 24 - 32 - 16 - 1); var_buffer_getmemory( &buffer, NULL, i_size - 24 - 32 - 16 - 1);
if( CmpGuid( &stream_type, &asf_object_stream_type_video ) ) if( CmpGuid( &stream_type, &asf_object_stream_type_video ) )
{ {
//fprintf( stderr, "\nvideo stream[%d] found\n", i_stream_id );
hdr->stream[i_stream_id].i_cat = ASF_STREAM_VIDEO; hdr->stream[i_stream_id].i_cat = ASF_STREAM_VIDEO;
} }
else if( CmpGuid( &stream_type, &asf_object_stream_type_audio ) ) else if( CmpGuid( &stream_type, &asf_object_stream_type_audio ) )
{ {
//fprintf( stderr, "\naudio stream[%d] found\n", i_stream_id );
hdr->stream[i_stream_id].i_cat = ASF_STREAM_AUDIO; hdr->stream[i_stream_id].i_cat = ASF_STREAM_AUDIO;
} }
else else
...@@ -197,8 +175,6 @@ void E_( asf_HeaderParse )( asf_header_t *hdr, ...@@ -197,8 +175,6 @@ void E_( asf_HeaderParse )( asf_header_t *hdr,
int i_count; int i_count;
uint8_t i_stream_id; uint8_t i_stream_id;
//fprintf( stderr, "bitrate properties\n" );
i_count = var_buffer_get16( &buffer ); i_count = var_buffer_get16( &buffer );
i_size -= 2; i_size -= 2;
while( i_count > 0 ) while( i_count > 0 )
...@@ -208,13 +184,10 @@ void E_( asf_HeaderParse )( asf_header_t *hdr, ...@@ -208,13 +184,10 @@ void E_( asf_HeaderParse )( asf_header_t *hdr,
i_count--; i_count--;
i_size -= 6; i_size -= 6;
} }
//fprintf( stderr, " 2---------------------skip:%lld\n", i_size - 24);
var_buffer_getmemory( &buffer, NULL, i_size - 24 ); var_buffer_getmemory( &buffer, NULL, i_size - 24 );
} }
else else
{ {
//fprintf( stderr, "unknown\n" );
//fprintf( stderr, " 3---------------------skip:%lld\n", i_size - 24);
// skip unknown guid // skip unknown guid
var_buffer_getmemory( &buffer, NULL, i_size - 24 ); var_buffer_getmemory( &buffer, NULL, i_size - 24 );
} }
...@@ -255,7 +228,8 @@ void E_( asf_StreamSelect ) ( asf_header_t *hdr, ...@@ -255,7 +228,8 @@ void E_( asf_StreamSelect ) ( asf_header_t *hdr,
{ {
for( i = 0; i < 128; i++ ) for( i = 0; i < 128; i++ )
{ {
hdr->stream[i].i_selected = 0; /* by default, not selected */ /* by default, not selected */
hdr->stream[i].i_selected = 0;
} }
} }
...@@ -315,7 +289,6 @@ void E_( asf_StreamSelect ) ( asf_header_t *hdr, ...@@ -315,7 +289,6 @@ void E_( asf_StreamSelect ) ( asf_header_t *hdr,
) ) ) ) ) ) ) )
{ {
/* unselect old stream */ /* unselect old stream */
if( i_video > 0 ) if( i_video > 0 )
{ {
hdr->stream[i_video].i_selected = 0; hdr->stream[i_video].i_selected = 0;
...@@ -335,4 +308,3 @@ void E_( asf_StreamSelect ) ( asf_header_t *hdr, ...@@ -335,4 +308,3 @@ void E_( asf_StreamSelect ) ( asf_header_t *hdr,
} }
} }
...@@ -98,7 +98,6 @@ void var_buffer_add64( var_buffer_t *p_buf, uint64_t i_long ) ...@@ -98,7 +98,6 @@ void var_buffer_add64( var_buffer_t *p_buf, uint64_t i_long )
var_buffer_add32( p_buf, ( i_long >> 32 )&0xffffffff ); var_buffer_add32( p_buf, ( i_long >> 32 )&0xffffffff );
} }
void var_buffer_addmemory( var_buffer_t *p_buf, void *p_mem, int i_mem ) void var_buffer_addmemory( var_buffer_t *p_buf, void *p_mem, int i_mem )
{ {
/* check if there is enough data */ /* check if there is enough data */
...@@ -175,7 +174,6 @@ uint8_t var_buffer_get8 ( var_buffer_t *p_buf ) ...@@ -175,7 +174,6 @@ uint8_t var_buffer_get8 ( var_buffer_t *p_buf )
return( i_byte ); return( i_byte );
} }
uint16_t var_buffer_get16( var_buffer_t *p_buf ) uint16_t var_buffer_get16( var_buffer_t *p_buf )
{ {
uint16_t i_b1, i_b2; uint16_t i_b1, i_b2;
...@@ -218,7 +216,6 @@ int var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int64_t i_mem ) ...@@ -218,7 +216,6 @@ int var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int64_t i_mem )
} }
if( i_copy < 0 ) if( i_copy < 0 )
{ {
// fprintf( stderr, "\n**************arrrrrrggggg\n" );
i_copy = 0; i_copy = 0;
} }
p_buf->i_data += i_copy; p_buf->i_data += i_copy;
...@@ -243,4 +240,3 @@ void var_buffer_getguid( var_buffer_t *p_buf, guid_t *p_guid ) ...@@ -243,4 +240,3 @@ void var_buffer_getguid( var_buffer_t *p_buf, guid_t *p_guid )
p_guid->v4[i] = var_buffer_get8( p_buf ); p_guid->v4[i] = var_buffer_get8( p_buf );
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment