598
599
if (pack_start_code != 0x000001ba) {
599
600
if( pack_start_code == 0 && IgnoreErrors ) {
600
fprintf(stderr, "Bad pack start code at %llu: %08lx\n", rtell (ptr), pack_start_code);
601
static int _Warn = 0;
602
if( _Warn < 1000 ) { /* Avoid too many trace */
603
fprintf(stderr, "Bad pack start code at %llu: %08lx\n", rtell (ptr), pack_start_code);
601
606
return( -1 ); /* Skip it */
603
608
fatal ("Bad pack start code at %llu: %08lx", rtell (ptr), pack_start_code);
662
667
sequence_headers++;
666
pad_packet_length = 0;
668
if (14 + vid_packet_length < SECT_SIZE - 6)
670
// video packet does not fill whole sector
671
// check for padding packet
672
ptr += vid_packet_length;
674
pad_packet_start_code = (UInt32) (ptr [0]) << 24;
675
pad_packet_start_code |= (UInt32) (ptr [1]) << 16;
676
pad_packet_start_code |= (UInt32) (ptr [2]) << 8;
677
pad_packet_start_code |= (UInt32) (ptr [3]);
679
if (pad_packet_start_code != 0x000001be)
680
fatal ("Bad padding packet start code at %llu: %08lx",
681
rtell (ptr + vid_packet_length), pad_packet_start_code);
683
pad_packet_length = ptr [4] << 8;
684
pad_packet_length |= ptr [5];
685
pad_packet_length += 6;
688
// length of video packet plus padding packet must always match sector size
689
if (14 + vid_packet_length + pad_packet_length != SECT_SIZE)
690
fatal ("Bad video packet length at %llu: vpl=%d ppl=%d",
691
rtell (ptr), vid_packet_length, pad_packet_length );
670
/* These errors seems to arrives with some old DVDs but the result is good !
671
So we just emit a warning instead of an error
673
pad_packet_length = 0;
675
if (14 + vid_packet_length < SECT_SIZE - 6) {
676
// video packet does not fill whole sector
677
// check for padding packet
678
ptr += vid_packet_length;
680
pad_packet_start_code = (UInt32) (ptr [0]) << 24;
681
pad_packet_start_code |= (UInt32) (ptr [1]) << 16;
682
pad_packet_start_code |= (UInt32) (ptr [2]) << 8;
683
pad_packet_start_code |= (UInt32) (ptr [3]);
685
pad_packet_length = ptr [4] << 8;
686
pad_packet_length |= ptr [5];
687
pad_packet_length += 6;
689
if (pad_packet_start_code != 0x000001be)
690
warning("Bad padding packet start code at %llu: %08x vid_packet_length: %d pad_packet_length: %d",
691
rtell(ptr + vid_packet_length),
692
pad_packet_start_code,
698
// length of video packet plus padding packet must always match sector size
699
if( 14 + vid_packet_length + pad_packet_length != SECT_SIZE)
700
warning("Bad video packet length at %llu: vpl=%d ppl=%d",
701
rtell(ptr), vid_packet_length, pad_packet_length );
1479
warning (char *fmt, ...)
1484
fprintf (stderr, "%s: Warning: ", progname);
1487
vsnprintf( buffer, sizeof(buffer), fmt, ap);
1488
fprintf(stderr,"%s\n", buffer );