comparison vobsub.c @ 4786:71c3a45cf1fd

forgot to commit
author atmos4
date Thu, 21 Feb 2002 14:34:52 +0000
parents aeb27b09de8e
children 1ee5574d67d6
comparison
equal deleted inserted replaced
4785:fefd14e3072f 4786:71c3a45cf1fd
604 mpeg_t *mpg; 604 mpeg_t *mpg;
605 strcpy(buf, name); 605 strcpy(buf, name);
606 strcat(buf, ".ifo"); 606 strcat(buf, ".ifo");
607 fd = fopen(buf, "rb"); 607 fd = fopen(buf, "rb");
608 if (fd == NULL) 608 if (fd == NULL)
609 perror("Can't open IFO file"); 609 perror("VobSub: Can't open IFO file");
610 else { 610 else {
611 // parse IFO header 611 // parse IFO header
612 unsigned char block[0x800]; 612 unsigned char block[0x800];
613 const char *const ifo_magic = "DVDVIDEO-VTS"; 613 const char *const ifo_magic = "DVDVIDEO-VTS";
614 if (fread(block, sizeof(block), 1, fd) != 1) 614 if (fread(block, sizeof(block), 1, fd) != 1)
659 /* read in the index */ 659 /* read in the index */
660 strcpy(buf, name); 660 strcpy(buf, name);
661 strcat(buf, ".idx"); 661 strcat(buf, ".idx");
662 fd = fopen(buf, "rb"); 662 fd = fopen(buf, "rb");
663 if (fd == NULL) 663 if (fd == NULL)
664 perror("Can't open IDX file"); 664 perror("VobSub: Can't open IDX file");
665 else { 665 else {
666 while (vobsub_parse_one_line(vob, fd) >= 0) 666 while (vobsub_parse_one_line(vob, fd) >= 0)
667 /* NOOP */ ; 667 /* NOOP */ ;
668 fclose(fd); 668 fclose(fd);
669 } 669 }
671 /* read the indexed mpeg_stream */ 671 /* read the indexed mpeg_stream */
672 strcpy(buf, name); 672 strcpy(buf, name);
673 strcat(buf, ".sub"); 673 strcat(buf, ".sub");
674 mpg = mpeg_open(buf); 674 mpg = mpeg_open(buf);
675 if (mpg == NULL) 675 if (mpg == NULL)
676 perror("Can't open SUB file"); 676 perror("VobSub: Can't open SUB file");
677 else { 677 else {
678 long last_pts_diff = 0; 678 long last_pts_diff = 0;
679 while (!mpeg_eof(mpg)) { 679 while (!mpeg_eof(mpg)) {
680 off_t pos = mpeg_tell(mpg); 680 off_t pos = mpeg_tell(mpg);
681 if (mpeg_run(mpg) < 0) { 681 if (mpeg_run(mpg) < 0) {