Changeset 121f3c3e7ac8cccafa0f300699b4e82af681be92
- Timestamp:
- 03/10/07 20:36:03
(1 year ago)
- Author:
- Rafaël Carré <funman@videolan.org>
- git-committer:
- Rafaël Carré <funman@videolan.org> 1191436563 +0000
- git-parent:
[67079185907a0df3bd3d529bf4231979e9db6bfe]
- git-author:
- Rafaël Carré <funman@videolan.org> 1191436563 +0000
- Message:
mp4 demuxer: don't try to print not printable characters.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3f07af6 |
r121f3c3 |
|
| 111 | 111 | */ |
|---|
| 112 | 112 | |
|---|
| | 113 | /* This macro is used when we want to printf the box type |
|---|
| | 114 | * APPLE annotation box is : |
|---|
| | 115 | * either 0xA9 + 24-bit ASCII text string (and 0xA9 isn't printable) |
|---|
| | 116 | * either 32-bit ASCII text string |
|---|
| | 117 | */ |
|---|
| | 118 | #define MP4_BOX_TYPE_ASCII() ( ((char*)&p_box->i_type)[0] != (char)0xA9 ) |
|---|
| | 119 | |
|---|
| 113 | 120 | static uint32_t Get24bBE( const uint8_t *p ) |
|---|
| 114 | 121 | { |
|---|
| … | … | |
| 207 | 214 | if( p_box->i_size ) |
|---|
| 208 | 215 | { |
|---|
| 209 | | msg_Dbg( p_stream, "found Box: %4.4s size "I64Fd, |
|---|
| 210 | | (char*)&p_box->i_type, p_box->i_size ); |
|---|
| | 216 | if MP4_BOX_TYPE_ASCII() |
|---|
| | 217 | msg_Dbg( p_stream, "found Box: %4.4s size "I64Fd, |
|---|
| | 218 | (char*)&p_box->i_type, p_box->i_size ); |
|---|
| | 219 | else |
|---|
| | 220 | msg_Dbg( p_stream, "found Box: c%3.3s size "I64Fd, |
|---|
| | 221 | (char*)&p_box->i_type+1, p_box->i_size ); |
|---|
| 211 | 222 | } |
|---|
| 212 | 223 | #endif |
|---|
| … | … | |
| 339 | 350 | /* Nothing to do */ |
|---|
| 340 | 351 | #ifdef MP4_VERBOSE |
|---|
| 341 | | msg_Dbg( p_stream, "skip box: \"%4.4s\"", (char*)&p_box->i_type ); |
|---|
| | 352 | if MP4_BOX_TYPE_ASCII() |
|---|
| | 353 | msg_Dbg( p_stream, "skip box: \"%4.4s\"", (char*)&p_box->i_type ); |
|---|
| | 354 | else |
|---|
| | 355 | msg_Dbg( p_stream, "skip box: \"c%3.3s\"", (char*)&p_box->i_type+1 ); |
|---|
| 342 | 356 | #endif |
|---|
| 343 | 357 | return 1; |
|---|
| … | … | |
| 605 | 619 | |
|---|
| 606 | 620 | #ifdef MP4_VERBOSE |
|---|
| 607 | | msg_Dbg( p_stream, "read box: \"hdlr\" handler type %4.4s name %s", |
|---|
| 608 | | (char*)&p_box->data.p_hdlr->i_handler_type, |
|---|
| 609 | | p_box->data.p_hdlr->psz_name ); |
|---|
| | 621 | msg_Dbg( p_stream, "read box: \"hdlr\" handler type %4.4s name %s", |
|---|
| | 622 | (char*)&p_box->data.p_hdlr->i_handler_type, |
|---|
| | 623 | p_box->data.p_hdlr->psz_name ); |
|---|
| 610 | 624 | |
|---|
| 611 | 625 | #endif |
|---|
| … | … | |
| 1961 | 1975 | #ifdef MP4_VERBOSE |
|---|
| 1962 | 1976 | msg_Dbg( p_stream, |
|---|
| 1963 | | "read box: \"rdrf\" type:%4.4s ref %s", |
|---|
| 1964 | | (char*)&p_box->data.p_rdrf->i_ref_type, |
|---|
| 1965 | | p_box->data.p_rdrf->psz_ref ); |
|---|
| 1966 | | |
|---|
| | 1977 | "read box: \"rdrf\" type:%4.4s ref %s", |
|---|
| | 1978 | (char*)&p_box->data.p_rdrf->i_ref_type, |
|---|
| | 1979 | p_box->data.p_rdrf->psz_ref ); |
|---|
| 1967 | 1980 | #endif |
|---|
| 1968 | 1981 | MP4_READBOX_EXIT( 1 ); |
|---|
| … | … | |
| 2064 | 2077 | default: psz_error = "unknown error"; break; |
|---|
| 2065 | 2078 | } |
|---|
| 2066 | | |
|---|
| 2067 | | msg_Err( p_stream, "drms_init(%4.4s) failed (%s)", |
|---|
| 2068 | | (char *)&p_box->i_type, psz_error ); |
|---|
| | 2079 | if MP4_BOX_TYPE_ASCII() |
|---|
| | 2080 | msg_Err( p_stream, "drms_init(%4.4s) failed (%s)", |
|---|
| | 2081 | (char *)&p_box->i_type, psz_error ); |
|---|
| | 2082 | else |
|---|
| | 2083 | msg_Err( p_stream, "drms_init(c%3.3s) failed (%s)", |
|---|
| | 2084 | (char *)&p_box->i_type+1, psz_error ); |
|---|
| 2069 | 2085 | |
|---|
| 2070 | 2086 | drms_free( p_drms_box->data.p_sample_soun->p_drms ); |
|---|
| … | … | |
| 2303 | 2319 | |
|---|
| 2304 | 2320 | unknown: |
|---|
| 2305 | | msg_Warn( p_stream, |
|---|
| 2306 | | "unknown box type %4.4s (uncompletetly loaded)", |
|---|
| 2307 | | (char*)&p_box->i_type ); |
|---|
| | 2321 | if MP4_BOX_TYPE_ASCII() |
|---|
| | 2322 | msg_Warn( p_stream, |
|---|
| | 2323 | "unknown box type %4.4s (uncompletetly loaded)", |
|---|
| | 2324 | (char*)&p_box->i_type ); |
|---|
| | 2325 | else |
|---|
| | 2326 | msg_Warn( p_stream, |
|---|
| | 2327 | "unknown box type c%3.3s (uncompletetly loaded)", |
|---|
| | 2328 | (char*)&p_box->i_type+1 ); |
|---|
| 2308 | 2329 | |
|---|
| 2309 | 2330 | return 1; |
|---|
| … | … | |
| 2587 | 2608 | { |
|---|
| 2588 | 2609 | /* Should not happen */ |
|---|
| 2589 | | msg_Warn( s, |
|---|
| 2590 | | "cannot free box %4.4s, type unknown", |
|---|
| 2591 | | (char*)&p_box->i_type ); |
|---|
| | 2610 | if MP4_BOX_TYPE_ASCII() |
|---|
| | 2611 | msg_Warn( s, |
|---|
| | 2612 | "cannot free box %4.4s, type unknown", |
|---|
| | 2613 | (char*)&p_box->i_type ); |
|---|
| | 2614 | else |
|---|
| | 2615 | msg_Warn( s, |
|---|
| | 2616 | "cannot free box c%3.3s, type unknown", |
|---|
| | 2617 | (char*)&p_box->i_type+1 ); |
|---|
| 2592 | 2618 | } |
|---|
| 2593 | 2619 | else |
|---|
| … | … | |
| 2671 | 2697 | if( !i_level ) |
|---|
| 2672 | 2698 | { |
|---|
| 2673 | | msg_Dbg( s, "dumping root Box \"%4.4s\"", |
|---|
| 2674 | | (char*)&p_box->i_type ); |
|---|
| | 2699 | if MP4_BOX_TYPE_ASCII() |
|---|
| | 2700 | msg_Dbg( s, "dumping root Box \"%4.4s\"", |
|---|
| | 2701 | (char*)&p_box->i_type ); |
|---|
| | 2702 | else |
|---|
| | 2703 | msg_Dbg( s, "dumping root Box \"c%3.3s\"", |
|---|
| | 2704 | (char*)&p_box->i_type+1 ); |
|---|
| 2675 | 2705 | } |
|---|
| 2676 | 2706 | else |
|---|
| … | … | |
| 2683 | 2713 | str[i*5] = '|'; |
|---|
| 2684 | 2714 | } |
|---|
| 2685 | | sprintf( str + i_level * 5, "+ %4.4s size %d", |
|---|
| 2686 | | (char*)&p_box->i_type, |
|---|
| 2687 | | (uint32_t)p_box->i_size ); |
|---|
| 2688 | | |
|---|
| | 2715 | if MP4_BOX_TYPE_ASCII() |
|---|
| | 2716 | sprintf( str + i_level * 5, "+ %4.4s size %d", |
|---|
| | 2717 | (char*)&p_box->i_type, (uint32_t)p_box->i_size ); |
|---|
| | 2718 | else |
|---|
| | 2719 | sprintf( str + i_level * 5, "+ c%3.3s size %d", |
|---|
| | 2720 | (char*)&p_box->i_type+1, (uint32_t)p_box->i_size ); |
|---|
| 2689 | 2721 | msg_Dbg( s, "%s", str ); |
|---|
| 2690 | 2722 | } |
|---|