X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;ds=sidebyside;f=cinelerra-5.1%2Flibzmpeg3%2Fmpeg3ifochk.C;fp=cinelerra-5.1%2Flibzmpeg3%2Fmpeg3ifochk.C;h=9fe9d18bb46d1e6aa56dcf1838a8475be2a8a785;hb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;hp=0000000000000000000000000000000000000000;hpb=52fcc46226f9df46f9ce9d0566dc568455a7db0b;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/libzmpeg3/mpeg3ifochk.C b/cinelerra-5.1/libzmpeg3/mpeg3ifochk.C new file mode 100644 index 00000000..9fe9d18b --- /dev/null +++ b/cinelerra-5.1/libzmpeg3/mpeg3ifochk.C @@ -0,0 +1,106 @@ + +#include +#include "libzmpeg3.h" + +/* reads a ifo file which must be a dvd, and vaidates the title data */ +/* reports title/program sets which appear to be usable */ + +int usage(const char *nm) +{ + printf("usage: %s \n" + " = path to dvd mount point\n", nm); + return 0; +} + +int main(int argc, char **argv) +{ + if( argc < 2 ) + return usage(argv[0]); + + int verbose = 0; + int program = -1; + int limit = 3; + const char *path = 0; + + int i; + for( i=1; ifs->read_uint32(); + if( bits == zmpeg3_t::IFO_PREFIX ) { + int fd = src->fs->get_fd(); + zifo_t *ifo = src->ifo_open(fd, 0); + if( !ifo ) { + fprintf(stderr,"Error opening ifo in %s\n", &ifo_path[0]); + continue; + } + + zicell_table_t icell_addrs; + ifo->icell_addresses(&icell_addrs); + int programs = ifo->max_inlv+1; + int angles = -1; + if( verbose ) + printf("processing: %s, %d programs\n",&ifo_path[0], programs); + + for( int title=0; title<100; ++title ) { + int listed = 0; + for( int pgm=0; pgmchk(title, 0, pgm, 0, &icell_addrs, sectors, pcells, angles); + if( ret < 0 ) break; + if( !ret ) continue; + if( pcells < limit ) continue; + if( program >= 0 && pgm != program ) continue; + if( !listed ) { + listed = 1; + printf("%s, Title = %d, pcells=%d, sectors = %d, angles %d, program ids=%d", + &ifo_path[0], title+1, pcells, sectors, angles+1, title*100+pgm); + } + else + printf(", %d",title*100+pgm); + } + if( listed ) printf("\n"); + } + ifo->ifo_close(); + } + + delete src; + } + + if( i == 1 ) { + printf("cant open %s/VIDEO_TS/VTS_01_0.IFO\n",path); + exit(1); + } + + return 0; +} +