Changeset 8770fee892dd00dfcc812acabb5a39619247698f
- 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
| r101b342 |
r8770fee |
|
| 61 | 61 | } |
|---|
| 62 | 62 | |
|---|
| 63 | | int ASF_CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 ) |
|---|
| | 63 | bool ASF_CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 ) |
|---|
| 64 | 64 | { |
|---|
| 65 | 65 | if( (p_guid1->v1 != p_guid2->v1 )|| |
|---|
| … | … | |
| 68 | 68 | ( memcmp( p_guid1->v4, p_guid2->v4,8 )) ) |
|---|
| 69 | 69 | { |
|---|
| 70 | | return( 0 ); |
|---|
| 71 | | } |
|---|
| 72 | | return( 1 ); /* match */ |
|---|
| | 70 | return false; |
|---|
| | 71 | } |
|---|
| | 72 | return true; |
|---|
| 73 | 73 | } |
|---|
| 74 | 74 | |
|---|
| … | … | |
| 82 | 82 | |
|---|
| 83 | 83 | if( stream_Peek( s, &p_peek, 24 ) < 24 ) |
|---|
| 84 | | { |
|---|
| 85 | | return( VLC_EGENERIC ); |
|---|
| 86 | | } |
|---|
| | 84 | return VLC_EGENERIC; |
|---|
| | 85 | |
|---|
| 87 | 86 | ASF_GetGUID( &p_common->i_object_id, p_peek ); |
|---|
| 88 | 87 | p_common->i_object_size = GetQWLE( p_peek + 16 ); |
|---|
| … | … | |
| 97 | 96 | #endif |
|---|
| 98 | 97 | |
|---|
| 99 | | return( VLC_SUCCESS ); |
|---|
| | 98 | return VLC_SUCCESS; |
|---|
| 100 | 99 | } |
|---|
| 101 | 100 | |
|---|
| … | … | |
| 106 | 105 | { |
|---|
| 107 | 106 | if( ASF_ReadObjectCommon( s, &obj ) ) |
|---|
| 108 | | { |
|---|
| 109 | | return( VLC_EGENERIC ); |
|---|
| 110 | | } |
|---|
| | 107 | return VLC_EGENERIC; |
|---|
| | 108 | |
|---|
| 111 | 109 | p_obj = &obj; |
|---|
| 112 | 110 | } |
|---|
| 113 | 111 | |
|---|
| 114 | 112 | if( p_obj->common.i_object_size <= 0 ) |
|---|
| 115 | | { |
|---|
| 116 | 113 | return VLC_EGENERIC; |
|---|
| 117 | | } |
|---|
| | 114 | |
|---|
| 118 | 115 | if( p_obj->common.p_father && |
|---|
| 119 | 116 | p_obj->common.p_father->common.i_object_size != 0 ) |
|---|
| … | … | |
| 136 | 133 | { |
|---|
| 137 | 134 | VLC_UNUSED(pp_obj); |
|---|
| 138 | | return; |
|---|
| 139 | 135 | } |
|---|
| 140 | 136 | |
|---|
| … | … | |
| 147 | 143 | |
|---|
| 148 | 144 | if( ( i_peek = stream_Peek( s, &p_peek, 30 ) ) < 30 ) |
|---|
| 149 | | { |
|---|
| 150 | | return( VLC_EGENERIC ); |
|---|
| 151 | | } |
|---|
| | 145 | return VLC_EGENERIC; |
|---|
| 152 | 146 | |
|---|
| 153 | 147 | p_hdr->i_sub_object_count = GetDWLE( p_peek + 24 ); |
|---|
| … | … | |
| 179 | 173 | } |
|---|
| 180 | 174 | if( ASF_NextObject( s, p_subobj ) ) /* Go to the next object */ |
|---|
| 181 | | { |
|---|
| 182 | 175 | break; |
|---|
| 183 | | } |
|---|
| 184 | 176 | } |
|---|
| 185 | 177 | return VLC_SUCCESS; |
|---|
| … | … | |
| 193 | 185 | |
|---|
| 194 | 186 | if( ( i_peek = stream_Peek( s, &p_peek, 50 ) ) < 50 ) |
|---|
| 195 | | { |
|---|
| 196 | 187 | return VLC_EGENERIC; |
|---|
| 197 | | } |
|---|
| | 188 | |
|---|
| 198 | 189 | ASF_GetGUID( &p_data->i_file_id, p_peek + 24 ); |
|---|
| 199 | 190 | p_data->i_total_data_packets = GetQWLE( p_peek + 40 ); |
|---|
| … | … | |
| 218 | 209 | int i; |
|---|
| 219 | 210 | |
|---|
| | 211 | /* We just ignore error on the index */ |
|---|
| 220 | 212 | if( stream_Peek( s, &p_peek, p_index->i_object_size ) < |
|---|
| 221 | 213 | __MAX( (int)p_index->i_object_size, 56 ) ) |
|---|
| 222 | | { |
|---|
| 223 | | /* Just ignore */ |
|---|
| 224 | 214 | return VLC_SUCCESS; |
|---|
| 225 | | } |
|---|
| 226 | 215 | |
|---|
| 227 | 216 | ASF_GetGUID( &p_index->i_file_id, p_peek + 24 ); |
|---|
| … | … | |
| 273 | 262 | |
|---|
| 274 | 263 | if( ( i_peek = stream_Peek( s, &p_peek, 104 ) ) < 104 ) |
|---|
| 275 | | { |
|---|
| 276 | 264 | return VLC_EGENERIC; |
|---|
| 277 | | } |
|---|
| | 265 | |
|---|
| 278 | 266 | ASF_GetGUID( &p_fp->i_file_id, p_peek + 24 ); |
|---|
| 279 | 267 | p_fp->i_file_size = GetQWLE( p_peek + 40 ); |
|---|
| … | … | |
| 331 | 319 | #endif |
|---|
| 332 | 320 | |
|---|
| 333 | | p_meta->i_record_entries_count = 0; |
|---|
| 334 | | p_meta->record = 0; |
|---|
| 335 | | |
|---|
| 336 | 321 | if( stream_Peek( s, &p_peek, p_meta->i_object_size ) < |
|---|
| 337 | 322 | __MAX( (int)p_meta->i_object_size, 26 ) ) |
|---|
| 338 | | { |
|---|
| 339 | 323 | return VLC_EGENERIC; |
|---|
| 340 | | } |
|---|
| | 324 | |
|---|
| | 325 | p_meta->i_record_entries_count = 0; |
|---|
| | 326 | p_meta->record = NULL; |
|---|
| 341 | 327 | |
|---|
| 342 | 328 | i_peek = 24; |
|---|
| … | … | |
| 516 | 502 | |
|---|
| 517 | 503 | if( ( i_peek = stream_Peek( s, &p_peek, p_sp->i_object_size ) ) < 78 ) |
|---|
| 518 | | { |
|---|
| 519 | 504 | return VLC_EGENERIC; |
|---|
| 520 | | } |
|---|
| 521 | 505 | |
|---|
| 522 | 506 | ASF_GetGUID( &p_sp->i_stream_type, p_peek + 24 ); |
|---|
| … | … | |
| 610 | 594 | |
|---|
| 611 | 595 | if( ( i_peek = stream_Peek( s, &p_peek, p_cl->i_object_size ) ) < 44 ) |
|---|
| 612 | | { |
|---|
| 613 | 596 | return VLC_EGENERIC; |
|---|
| 614 | | } |
|---|
| 615 | 597 | |
|---|
| 616 | 598 | ASF_GetGUID( &p_cl->i_reserved, p_peek + 24 ); |
|---|
| … | … | |
| 719 | 701 | |
|---|
| 720 | 702 | if( ( i_peek = stream_Peek( s, &p_peek, p_cd->i_object_size ) ) < 34 ) |
|---|
| 721 | | { |
|---|
| 722 | 703 | return VLC_EGENERIC; |
|---|
| 723 | | } |
|---|
| 724 | 704 | |
|---|
| 725 | 705 | cd = vlc_iconv_open("UTF-8", "UTF-16LE"); |
|---|
| 726 | | if ( cd == (vlc_iconv_t)-1 ) { |
|---|
| | 706 | if( cd == (vlc_iconv_t)-1 ) |
|---|
| | 707 | { |
|---|
| 727 | 708 | msg_Err( s, "vlc_iconv_open failed" ); |
|---|
| 728 | 709 | return VLC_EGENERIC; |
|---|
| … | … | |
| 877 | 858 | static void ASF_FreeObject_stream_bitrate_properties( asf_object_t *p_obj) |
|---|
| 878 | 859 | { |
|---|
| | 860 | VLC_UNUSED(p_obj); |
|---|
| 879 | 861 | } |
|---|
| 880 | 862 | |
|---|
| … | … | |
| 1287 | 1269 | |
|---|
| 1288 | 1270 | if( !p_obj ) |
|---|
| 1289 | | return( 0 ); |
|---|
| | 1271 | return 0; |
|---|
| 1290 | 1272 | |
|---|
| 1291 | 1273 | memset( p_obj, 0, sizeof( *p_obj ) ); |
|---|
| … | … | |
| 1347 | 1329 | } |
|---|
| 1348 | 1330 | |
|---|
| 1349 | | return( i_result ); |
|---|
| | 1331 | return i_result; |
|---|
| 1350 | 1332 | } |
|---|
| 1351 | 1333 | |
|---|
| … | … | |
| 1355 | 1337 | asf_object_t *p_child; |
|---|
| 1356 | 1338 | |
|---|
| 1357 | | if( !p_obj ) return; |
|---|
| | 1339 | if( !p_obj ) |
|---|
| | 1340 | return; |
|---|
| 1358 | 1341 | |
|---|
| 1359 | 1342 | /* Free all child object */ |
|---|
| … | … | |
| 1396 | 1379 | } |
|---|
| 1397 | 1380 | free( p_obj ); |
|---|
| 1398 | | return; |
|---|
| 1399 | 1381 | } |
|---|
| 1400 | 1382 | |
|---|
| … | … | |
| 1528 | 1510 | |
|---|
| 1529 | 1511 | if( ASF_NextObject( s, p_obj ) ) /* Go to the next object */ |
|---|
| 1530 | | { |
|---|
| 1531 | 1512 | break; |
|---|
| 1532 | | } |
|---|
| 1533 | 1513 | } |
|---|
| 1534 | 1514 | |
|---|
| … | … | |
| 1605 | 1585 | asf_object_t *p_child; |
|---|
| 1606 | 1586 | |
|---|
| 1607 | | if( !p_obj ) return( 0 ); |
|---|
| | 1587 | if( !p_obj ) |
|---|
| | 1588 | return 0; |
|---|
| 1608 | 1589 | |
|---|
| 1609 | 1590 | i_count = 0; |
|---|
| … | … | |
| 1612 | 1593 | { |
|---|
| 1613 | 1594 | if( ASF_CmpGUID( &p_child->common.i_object_id, p_guid ) ) |
|---|
| 1614 | | { |
|---|
| 1615 | 1595 | i_count++; |
|---|
| 1616 | | } |
|---|
| | 1596 | |
|---|
| 1617 | 1597 | p_child = p_child->common.p_next; |
|---|
| 1618 | 1598 | } |
|---|
| 1619 | | return( i_count ); |
|---|
| | 1599 | return i_count; |
|---|
| 1620 | 1600 | } |
|---|
| 1621 | 1601 | |
|---|
| … | … | |
| 1632 | 1612 | { |
|---|
| 1633 | 1613 | if( i_number == 0 ) |
|---|
| 1634 | | { |
|---|
| 1635 | | /* We found it */ |
|---|
| 1636 | | return( p_child ); |
|---|
| 1637 | | } |
|---|
| | 1614 | return p_child; |
|---|
| 1638 | 1615 | |
|---|
| 1639 | 1616 | i_number--; |
|---|
| … | … | |
| 1641 | 1618 | p_child = p_child->common.p_next; |
|---|
| 1642 | 1619 | } |
|---|
| 1643 | | return( NULL ); |
|---|
| 1644 | | } |
|---|
| | 1620 | return NULL; |
|---|
| | 1621 | } |
|---|
| rb3f6001 |
r8770fee |
|
| 451 | 451 | |
|---|
| 452 | 452 | void 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 ); |
|---|
| | 453 | bool ASF_CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 ); |
|---|
| 454 | 454 | |
|---|
| 455 | 455 | asf_object_root_t *ASF_ReadObjectRoot( stream_t *, int b_seekable ); |
|---|