Changeset 06438cff3f2947f729362fe3bcea29551721a48c
- Timestamp:
- 06/04/05 11:31:38
(4 years ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1112779898 +0000
- git-parent:
[53a27d3eb660248ff99e968aed7f9d6854aacbe0]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1112779898 +0000
- Message:
- h264: bug fix (give valid date + split at the right place).
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra90a19a |
r06438cf |
|
| 68 | 68 | block_t *p_frame; |
|---|
| 69 | 69 | |
|---|
| 70 | | int64_t i_dts; |
|---|
| 71 | | int64_t i_pts; |
|---|
| 72 | | unsigned int i_flags; |
|---|
| 73 | | |
|---|
| 74 | 70 | vlc_bool_t b_sps; |
|---|
| 75 | 71 | |
|---|
| … | … | |
| 104 | 100 | NAL_SEI = 6, /* ref_idc == 0 */ |
|---|
| 105 | 101 | NAL_SPS = 7, |
|---|
| 106 | | NAL_PPS = 8 |
|---|
| | 102 | NAL_PPS = 8, |
|---|
| | 103 | NAL_AU_DELIMITER= 9 |
|---|
| 107 | 104 | /* ref_idc == 0 for 6,9,10,11,12 */ |
|---|
| 108 | 105 | }; |
|---|
| … | … | |
| 153 | 150 | p_sys->b_slice = VLC_FALSE; |
|---|
| 154 | 151 | p_sys->p_frame = NULL; |
|---|
| 155 | | p_sys->i_dts = 0; |
|---|
| 156 | | p_sys->i_pts = 0; |
|---|
| 157 | | p_sys->i_flags = 0; |
|---|
| 158 | 152 | p_sys->b_sps = VLC_FALSE; |
|---|
| 159 | 153 | |
|---|
| … | … | |
| 295 | 289 | break; |
|---|
| 296 | 290 | } |
|---|
| | 291 | #if 0 |
|---|
| | 292 | msg_Dbg( p_dec, "pts="I64Fd" dts="I64Fd, |
|---|
| | 293 | p_pic->i_pts, p_pic->i_dts ); |
|---|
| | 294 | #endif |
|---|
| 297 | 295 | |
|---|
| 298 | 296 | /* So p_block doesn't get re-added several times */ |
|---|
| … | … | |
| 419 | 417 | const int i_nal_ref_idc = (p_frag->p_buffer[3] >> 5)&0x03; |
|---|
| 420 | 418 | const int i_nal_type = p_frag->p_buffer[3]&0x1f; |
|---|
| | 419 | |
|---|
| | 420 | #define OUTPUT \ |
|---|
| | 421 | do { \ |
|---|
| | 422 | p_pic = block_ChainGather( p_sys->p_frame ); \ |
|---|
| | 423 | p_pic->i_length = 0; /* FIXME */ \ |
|---|
| | 424 | \ |
|---|
| | 425 | p_sys->p_frame = NULL; \ |
|---|
| | 426 | p_sys->b_slice = VLC_FALSE; \ |
|---|
| | 427 | } while(0) |
|---|
| | 428 | |
|---|
| 421 | 429 | |
|---|
| 422 | 430 | if( p_sys->b_slice && !p_sys->b_sps ) |
|---|
| … | … | |
| 508 | 516 | |
|---|
| 509 | 517 | if( b_pic && p_sys->b_slice ) |
|---|
| 510 | | { |
|---|
| 511 | | p_pic = block_ChainGather( p_sys->p_frame ); |
|---|
| 512 | | p_pic->i_dts = p_sys->i_dts; |
|---|
| 513 | | p_pic->i_pts = p_sys->i_pts; |
|---|
| 514 | | p_pic->i_length = 0; /* FIXME */ |
|---|
| 515 | | p_pic->i_flags = p_sys->i_flags; |
|---|
| 516 | | |
|---|
| 517 | | /* Reset context */ |
|---|
| 518 | | p_sys->p_frame = NULL; |
|---|
| 519 | | p_sys->b_slice = VLC_FALSE; |
|---|
| 520 | | } |
|---|
| | 518 | OUTPUT; |
|---|
| 521 | 519 | |
|---|
| 522 | 520 | p_sys->b_slice = VLC_TRUE; |
|---|
| 523 | | p_sys->i_flags = i_pic_flags; |
|---|
| 524 | | p_sys->i_dts = p_frag->i_dts; |
|---|
| 525 | | p_sys->i_pts = p_frag->i_pts; |
|---|
| 526 | 521 | |
|---|
| 527 | 522 | free( dec ); |
|---|
| … | … | |
| 640 | 635 | |
|---|
| 641 | 636 | free( dec ); |
|---|
| | 637 | |
|---|
| | 638 | |
|---|
| | 639 | if( p_sys->b_slice ) |
|---|
| | 640 | OUTPUT; |
|---|
| 642 | 641 | } |
|---|
| 643 | 642 | else if( i_nal_type == NAL_PPS ) |
|---|
| … | … | |
| 648 | 647 | /* TODO */ |
|---|
| 649 | 648 | msg_Dbg( p_dec, "found NAL_PPS" ); |
|---|
| 650 | | } |
|---|
| | 649 | |
|---|
| | 650 | if( p_sys->b_slice ) |
|---|
| | 651 | OUTPUT; |
|---|
| | 652 | } |
|---|
| | 653 | else if( i_nal_type == NAL_AU_DELIMITER || |
|---|
| | 654 | i_nal_type == NAL_SEI || |
|---|
| | 655 | ( i_nal_type >= 13 && i_nal_type <= 18 ) ) |
|---|
| | 656 | { |
|---|
| | 657 | if( p_sys->b_slice ) |
|---|
| | 658 | OUTPUT; |
|---|
| | 659 | } |
|---|
| | 660 | |
|---|
| | 661 | #undef OUTPUT |
|---|
| 651 | 662 | |
|---|
| 652 | 663 | /* Append the block */ |
|---|