Changeset 8770fee892dd00dfcc812acabb5a39619247698f

Show
Ignore:
Timestamp:
07/02/08 21:57:30 (2 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1215028650 +0000
git-parent:

[101b3425546c8f672f2375d433d62017baa16e16]

git-author:
Laurent Aimar <fenrir@videolan.org> 1215020108 +0000
Message:

Clean up.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/asf/libasf.c

    r101b342 r8770fee  
    6161} 
    6262 
    63 int ASF_CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 ) 
     63bool ASF_CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 ) 
    6464{ 
    6565    if( (p_guid1->v1 != p_guid2->v1 )|| 
     
    6868        ( memcmp( p_guid1->v4, p_guid2->v4,8 )) ) 
    6969    { 
    70         return( 0 )
    71     } 
    72     return( 1 ); /* match */ 
     70        return false
     71    } 
     72    return true; 
    7373} 
    7474 
     
    8282 
    8383    if( stream_Peek( s, &p_peek, 24 ) < 24 ) 
    84     { 
    85         return( VLC_EGENERIC ); 
    86     } 
     84        return VLC_EGENERIC; 
     85 
    8786    ASF_GetGUID( &p_common->i_object_id, p_peek ); 
    8887    p_common->i_object_size = GetQWLE( p_peek + 16 ); 
     
    9796#endif 
    9897 
    99     return( VLC_SUCCESS )
     98    return VLC_SUCCESS
    10099} 
    101100 
     
    106105    { 
    107106        if( ASF_ReadObjectCommon( s, &obj ) ) 
    108         { 
    109             return( VLC_EGENERIC ); 
    110         } 
     107            return VLC_EGENERIC; 
     108 
    111109        p_obj = &obj; 
    112110    } 
    113111 
    114112    if( p_obj->common.i_object_size <= 0 ) 
    115     { 
    116113        return VLC_EGENERIC; 
    117     } 
     114 
    118115    if( p_obj->common.p_father && 
    119116        p_obj->common.p_father->common.i_object_size != 0 ) 
     
    136133{ 
    137134    VLC_UNUSED(pp_obj); 
    138     return; 
    139135} 
    140136 
     
    147143 
    148144    if( ( i_peek = stream_Peek( s, &p_peek, 30 ) ) < 30 ) 
    149     { 
    150        return( VLC_EGENERIC ); 
    151     } 
     145       return VLC_EGENERIC; 
    152146 
    153147    p_hdr->i_sub_object_count = GetDWLE( p_peek + 24 ); 
     
    179173        } 
    180174        if( ASF_NextObject( s, p_subobj ) ) /* Go to the next object */ 
    181         { 
    182175            break; 
    183         } 
    184176    } 
    185177    return VLC_SUCCESS; 
     
    193185 
    194186    if( ( i_peek = stream_Peek( s, &p_peek, 50 ) ) < 50 ) 
    195     { 
    196187       return VLC_EGENERIC; 
    197     } 
     188 
    198189    ASF_GetGUID( &p_data->i_file_id, p_peek + 24 ); 
    199190    p_data->i_total_data_packets = GetQWLE( p_peek + 40 ); 
     
    218209    int                 i; 
    219210 
     211    /* We just ignore error on the index */ 
    220212    if( stream_Peek( s, &p_peek, p_index->i_object_size ) < 
    221213        __MAX( (int)p_index->i_object_size, 56 ) ) 
    222     { 
    223         /* Just ignore */ 
    224214        return VLC_SUCCESS; 
    225     } 
    226215 
    227216    ASF_GetGUID( &p_index->i_file_id, p_peek + 24 ); 
     
    273262 
    274263    if( ( i_peek = stream_Peek( s, &p_peek,  104 ) ) < 104 ) 
    275     { 
    276264       return VLC_EGENERIC; 
    277     } 
     265 
    278266    ASF_GetGUID( &p_fp->i_file_id, p_peek + 24 ); 
    279267    p_fp->i_file_size = GetQWLE( p_peek + 40 ); 
     
    331319#endif 
    332320 
    333     p_meta->i_record_entries_count = 0; 
    334     p_meta->record = 0; 
    335  
    336321    if( stream_Peek( s, &p_peek, p_meta->i_object_size ) < 
    337322        __MAX( (int)p_meta->i_object_size, 26 ) ) 
    338     { 
    339323       return VLC_EGENERIC; 
    340     } 
     324 
     325    p_meta->i_record_entries_count = 0; 
     326    p_meta->record = NULL; 
    341327 
    342328    i_peek = 24; 
     
    516502 
    517503    if( ( i_peek = stream_Peek( s, &p_peek,  p_sp->i_object_size ) ) < 78 ) 
    518     { 
    519504       return VLC_EGENERIC; 
    520     } 
    521505 
    522506    ASF_GetGUID( &p_sp->i_stream_type, p_peek + 24 ); 
     
    610594 
    611595    if( ( i_peek = stream_Peek( s, &p_peek, p_cl->i_object_size ) ) < 44 ) 
    612     { 
    613596       return VLC_EGENERIC; 
    614     } 
    615597 
    616598    ASF_GetGUID( &p_cl->i_reserved, p_peek + 24 ); 
     
    719701 
    720702    if( ( i_peek = stream_Peek( s, &p_peek, p_cd->i_object_size ) ) < 34 ) 
    721     { 
    722703       return VLC_EGENERIC; 
    723     } 
    724704 
    725705    cd = vlc_iconv_open("UTF-8", "UTF-16LE"); 
    726     if ( cd == (vlc_iconv_t)-1 ) { 
     706    if( cd == (vlc_iconv_t)-1 ) 
     707    { 
    727708        msg_Err( s, "vlc_iconv_open failed" ); 
    728709        return VLC_EGENERIC; 
     
    877858static void ASF_FreeObject_stream_bitrate_properties( asf_object_t *p_obj) 
    878859{ 
     860    VLC_UNUSED(p_obj); 
    879861} 
    880862 
     
    12871269 
    12881270    if( !p_obj ) 
    1289         return( 0 )
     1271        return 0
    12901272 
    12911273    memset( p_obj, 0, sizeof( *p_obj ) ); 
     
    13471329    } 
    13481330 
    1349     return( i_result )
     1331    return i_result
    13501332} 
    13511333 
     
    13551337    asf_object_t *p_child; 
    13561338 
    1357     if( !p_obj ) return; 
     1339    if( !p_obj ) 
     1340        return; 
    13581341 
    13591342    /* Free all child object */ 
     
    13961379    } 
    13971380    free( p_obj ); 
    1398     return; 
    13991381} 
    14001382 
     
    15281510 
    15291511        if( ASF_NextObject( s, p_obj ) ) /* Go to the next object */ 
    1530         { 
    15311512            break; 
    1532         } 
    15331513    } 
    15341514 
     
    16051585    asf_object_t *p_child; 
    16061586 
    1607     if( !p_obj ) return( 0 ); 
     1587    if( !p_obj ) 
     1588        return 0; 
    16081589 
    16091590    i_count = 0; 
     
    16121593    { 
    16131594        if( ASF_CmpGUID( &p_child->common.i_object_id, p_guid ) ) 
    1614         { 
    16151595            i_count++; 
    1616         } 
     1596 
    16171597        p_child = p_child->common.p_next; 
    16181598    } 
    1619     return( i_count )
     1599    return i_count
    16201600} 
    16211601 
     
    16321612        { 
    16331613            if( i_number == 0 ) 
    1634             { 
    1635                 /* We found it */ 
    1636                 return( p_child ); 
    1637             } 
     1614                return p_child; 
    16381615 
    16391616            i_number--; 
     
    16411618        p_child = p_child->common.p_next; 
    16421619    } 
    1643     return( NULL )
    1644 } 
     1620    return NULL
     1621} 
  • modules/demux/asf/libasf.h

    rb3f6001 r8770fee  
    451451 
    452452void ASF_GetGUID( guid_t *p_guid, const uint8_t *p_data ); 
    453 int ASF_CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 ); 
     453bool ASF_CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 ); 
    454454 
    455455asf_object_root_t *ASF_ReadObjectRoot( stream_t *, int b_seekable );