7 int main(int argc
, char *argv
[])
12 printf("Usage: mpeg3peek <table of contents> <frame number>\n");
13 printf("Print the byte offset of a given frame.\n");
14 printf("Only works for video. Requires table of contents.\n");
15 printf("Example: mpeg3peek heroine.toc 123\n");
20 file
= mpeg3_open(argv
[1], &error
);
23 if(!mpeg3_total_vstreams(file
))
25 printf("Need a video stream.\n");
29 if(!file
->vtrack
[0]->total_frame_offsets
)
31 printf("Zero length track. Did you load a table of contents?\n");
35 int frame_number
= atoi(argv
[2]);
36 if(frame_number
< 0) frame_number
= 0;
37 if(frame_number
> file
->vtrack
[0]->total_frame_offsets
)
38 frame_number
= file
->vtrack
[0]->total_frame_offsets
- 1;
39 printf("frame=%d offset=0x%llx\n",
41 file
->vtrack
[0]->frame_offsets
[frame_number
]);