X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Flibzmpeg3%2Fmpeg3show.C;fp=cinelerra-5.1%2Flibzmpeg3%2Fmpeg3show.C;h=60e0d1f62e5002b8e27c0b269679c13c771d17f5;hp=0000000000000000000000000000000000000000;hb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;hpb=52fcc46226f9df46f9ce9d0566dc568455a7db0b diff --git a/cinelerra-5.1/libzmpeg3/mpeg3show.C b/cinelerra-5.1/libzmpeg3/mpeg3show.C new file mode 100644 index 00000000..60e0d1f6 --- /dev/null +++ b/cinelerra-5.1/libzmpeg3/mpeg3show.C @@ -0,0 +1,44 @@ +#include "libzmpeg3.h" + +void usage() +{ + fprintf(stderr, "Show Table Of Contents\n" + "Usage: mpeg3show \n" + " opts: -a show audio sample offsets\n" + " -i show audio index\n" + " -v show video frame offsets\n"); + exit(1); +} + +int main(int argc, char *argv[]) +{ + if(argc < 2) { + fprintf(stderr, "Show Table Of Contents\n" + "Usage: mpeg3show \n"); + exit(1); + } + + int i; + int flags = 0; + for( i=1; i < argc; ++i ) { + char *cp = argv[i]; + if( *cp++ != '-' ) break; + while( *cp ) { + switch( *cp ) { + case 'a': flags |= TOC_SAMPLE_OFFSETS; break; + case 'i': flags |= TOC_AUDIO_INDEX; break; + case 'v': flags |= TOC_FRAME_OFFSETS; break; + default: + usage(); + } + ++cp; + } + } + + zmpeg3_t *file = new zmpeg3_t(argv[i]); + file->show_toc(flags); + delete file; + + return 0; +} +