| 433 | | tivo->size = numberParts * TIVO_PART_LENGTH; |
| 434 | | tivo->size += size; |
| | 432 | size += numberParts * TIVO_PART_LENGTH; |
| | 433 | |
| | 434 | if (tivo->tmf != 1) { |
| | 435 | /* If this isn't TMF, there may be more chained |
| | 436 | * PES headers on the end of this PART */ |
| | 437 | while ( size + CHUNKSIZE * 2 < |
| | 438 | demux->stream->end_pos ) { |
| | 439 | stream_seek( demux->stream, size + CHUNKSIZE ); |
| | 440 | readSize = stream_read(demux->stream, chunk, |
| | 441 | CHUNKSIZE); |
| | 442 | if ( readSize != CHUNKSIZE || |
| | 443 | AV_RB32(chunk) != TIVO_PES_FILEID ) break; |
| | 444 | size += (AV_RB24(chunk + 12) + 1) * CHUNKSIZE; |
| | 445 | } |
| | 446 | } |
| | 447 | size -= 4 * CHUNKSIZE; |
| | 448 | tivo->size = size; |