|
Last change
on this file since 74 was
74,
checked in by phkim, 10 years ago
|
- phkim
- zasc
- 변경 내용
- CT_ChMapUpdatePMTAC3AudioDescriptor 메모리 leak 버그 수정
|
-
Property svn:executable set to
*
|
|
File size:
915 bytes
|
| Line | |
|---|
| 1 | #include <stdio.h> |
|---|
| 2 | #include <stdlib.h> |
|---|
| 3 | |
|---|
| 4 | #include "bcmplayer.h" |
|---|
| 5 | |
|---|
| 6 | int main(int argc, char **argv) { |
|---|
| 7 | if (argc < 3) { |
|---|
| 8 | printf("Usage: ./indexfromoffset_test INDEXFILE HEXOFFSET\n"); |
|---|
| 9 | exit(1); |
|---|
| 10 | } |
|---|
| 11 | |
|---|
| 12 | const char *indexfile = argv[1]; |
|---|
| 13 | unsigned long offsetlo; |
|---|
| 14 | offsetlo = strtoul(argv[2], NULL, 16); |
|---|
| 15 | |
|---|
| 16 | printf("Params:\n"); |
|---|
| 17 | printf(" bcmindex file: %s\n", indexfile); |
|---|
| 18 | printf(" offset: %#x\n", offsetlo); |
|---|
| 19 | |
|---|
| 20 | FILE *f = fopen(argv[1], "rw"); |
|---|
| 21 | |
|---|
| 22 | BNAV_Player_Handle bcmp; |
|---|
| 23 | BNAV_Player_Settings settings; |
|---|
| 24 | |
|---|
| 25 | BNAV_Player_GetDefaultSettings(&settings); |
|---|
| 26 | settings.readCb = (BP_READ_CB)fread; |
|---|
| 27 | settings.seekCb = (BP_SEEK_CB)fseek; |
|---|
| 28 | settings.tellCb = (BP_TELL_CB)ftell; |
|---|
| 29 | settings.filePointer = f; |
|---|
| 30 | settings.videoPid = 1; // doesn't matter |
|---|
| 31 | |
|---|
| 32 | if (BNAV_Player_Open(&bcmp, &settings)) |
|---|
| 33 | exit(1); |
|---|
| 34 | |
|---|
| 35 | long index = BNAV_Player_FindIndexFromOffset(bcmp, 0, offsetlo); |
|---|
| 36 | |
|---|
| 37 | printf("\nFound: %d\n", index); |
|---|
| 38 | |
|---|
| 39 | BNAV_Player_Close(bcmp); |
|---|
| 40 | return 0; |
|---|
| 41 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.