Changeset a6b8118109995ae1b11f941af1b6f8290ed24f56
- Timestamp:
- 29/08/04 14:27:49
(4 years ago)
- Author:
- Gildas Bazin <gbazin@videolan.org>
- git-committer:
- Gildas Bazin <gbazin@videolan.org> 1093782469 +0000
- git-parent:
[381e1674700ab2f029bef8d18289a882ee894924]
- git-author:
- Gildas Bazin <gbazin@videolan.org> 1093782469 +0000
- Message:
* modules/demux/ogg.c: fixed skipped pictures problem when starting a stream.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r535be4f |
ra6b8118 |
|
| 480 | 480 | vlc_bool_t b_selected; |
|---|
| 481 | 481 | int i_header_len = 0; |
|---|
| 482 | | mtime_t i_pts = 0; |
|---|
| | 482 | mtime_t i_pts = -1, i_interpolated_pts; |
|---|
| 483 | 483 | |
|---|
| 484 | 484 | /* Sanity check */ |
|---|
| … | … | |
| 509 | 509 | { |
|---|
| 510 | 510 | uint8_t *p_extra; |
|---|
| 511 | | vlc_bool_t b_store_size = VLC_TRUE; |
|---|
| | 511 | vlc_bool_t b_store_size = VLC_TRUE; |
|---|
| 512 | 512 | |
|---|
| 513 | 513 | p_stream->i_packets_backup++; |
|---|
| … | … | |
| 523 | 523 | if( p_stream->i_packets_backup == 2 ) |
|---|
| 524 | 524 | { |
|---|
| 525 | | Ogg_ReadFlacHeader( p_demux, p_stream, p_oggpacket ); |
|---|
| | 525 | Ogg_ReadFlacHeader( p_demux, p_stream, p_oggpacket ); |
|---|
| 526 | 526 | p_stream->b_force_backup = 0; |
|---|
| 527 | 527 | } |
|---|
| … | … | |
| 553 | 553 | p_stream->fmt.p_extra = |
|---|
| 554 | 554 | realloc( p_stream->fmt.p_extra, p_stream->i_headers ); |
|---|
| 555 | | memcpy( p_stream->fmt.p_extra, p_stream->p_headers, |
|---|
| 556 | | p_stream->i_headers ); |
|---|
| | 555 | memcpy( p_stream->fmt.p_extra, p_stream->p_headers, |
|---|
| | 556 | p_stream->i_headers ); |
|---|
| 557 | 557 | es_out_Control( p_demux->out, ES_OUT_SET_FMT, |
|---|
| 558 | 558 | p_stream->p_es, &p_stream->fmt ); |
|---|
| … | … | |
| 589 | 589 | |
|---|
| 590 | 590 | /* Convert the granulepos into the next pcr */ |
|---|
| | 591 | i_interpolated_pts = p_stream->i_interpolated_pcr; |
|---|
| 591 | 592 | Ogg_UpdatePCR( p_stream, p_oggpacket ); |
|---|
| 592 | 593 | |
|---|
| … | … | |
| 624 | 625 | |
|---|
| 625 | 626 | if( !( p_block = block_New( p_demux, p_oggpacket->bytes ) ) ) return; |
|---|
| | 627 | |
|---|
| | 628 | /* Normalize PTS */ |
|---|
| | 629 | if( i_pts == 0 ) i_pts = 1; |
|---|
| | 630 | else if( i_pts == -1 && i_interpolated_pts == 0 ) i_pts = 1; |
|---|
| | 631 | else if( i_pts == -1 ) i_pts = 0; |
|---|
| 626 | 632 | |
|---|
| 627 | 633 | if( p_stream->fmt.i_cat == AUDIO_ES ) |
|---|
| … | … | |
| 1251 | 1257 | { |
|---|
| 1252 | 1258 | if( bs_read( &s, 24 ) >= 34 /*size STREAMINFO*/ ) |
|---|
| 1253 | | { |
|---|
| 1254 | | bs_skip( &s, 80 ); |
|---|
| 1255 | | p_stream->f_rate = p_stream->fmt.audio.i_rate = bs_read( &s, 20 ); |
|---|
| 1256 | | p_stream->fmt.audio.i_channels = bs_read( &s, 3 ) + 1; |
|---|
| 1257 | | |
|---|
| 1258 | | msg_Dbg( p_demux, "FLAC header, channels: %i, rate: %i", |
|---|
| 1259 | | p_stream->fmt.audio.i_channels, (int)p_stream->f_rate ); |
|---|
| 1260 | | } |
|---|
| 1261 | | else msg_Dbg( p_demux, "FLAC STREAMINFO metadata too short" ); |
|---|
| 1262 | | |
|---|
| 1263 | | /* Fake this as the last metadata block */ |
|---|
| 1264 | | *((uint8_t*)p_oggpacket->packet) |= 0x80; |
|---|
| | 1259 | { |
|---|
| | 1260 | bs_skip( &s, 80 ); |
|---|
| | 1261 | p_stream->f_rate = p_stream->fmt.audio.i_rate = bs_read( &s, 20 ); |
|---|
| | 1262 | p_stream->fmt.audio.i_channels = bs_read( &s, 3 ) + 1; |
|---|
| | 1263 | |
|---|
| | 1264 | msg_Dbg( p_demux, "FLAC header, channels: %i, rate: %i", |
|---|
| | 1265 | p_stream->fmt.audio.i_channels, (int)p_stream->f_rate ); |
|---|
| | 1266 | } |
|---|
| | 1267 | else msg_Dbg( p_demux, "FLAC STREAMINFO metadata too short" ); |
|---|
| | 1268 | |
|---|
| | 1269 | /* Fake this as the last metadata block */ |
|---|
| | 1270 | *((uint8_t*)p_oggpacket->packet) |= 0x80; |
|---|
| 1265 | 1271 | } |
|---|
| 1266 | 1272 | else |
|---|