|
|
@ -60,7 +60,7 @@ static void ts_str(char buffer[60], int64_t ts, AVRational base) |
|
|
|
int main(int argc, char **argv) |
|
|
|
int main(int argc, char **argv) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const char *filename; |
|
|
|
const char *filename; |
|
|
|
AVFormatContext *ic; |
|
|
|
AVFormatContext *ic = NULL; |
|
|
|
int i, ret, stream_id; |
|
|
|
int i, ret, stream_id; |
|
|
|
int64_t timestamp; |
|
|
|
int64_t timestamp; |
|
|
|
AVFormatParameters params, *ap= ¶ms; |
|
|
|
AVFormatParameters params, *ap= ¶ms; |
|
|
@ -79,13 +79,6 @@ int main(int argc, char **argv) |
|
|
|
|
|
|
|
|
|
|
|
filename = argv[1]; |
|
|
|
filename = argv[1]; |
|
|
|
|
|
|
|
|
|
|
|
/* allocate the media context */ |
|
|
|
|
|
|
|
ic = avformat_alloc_context(); |
|
|
|
|
|
|
|
if (!ic) { |
|
|
|
|
|
|
|
fprintf(stderr, "Memory error\n"); |
|
|
|
|
|
|
|
exit(1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret = av_open_input_file(&ic, filename, NULL, 0, ap); |
|
|
|
ret = av_open_input_file(&ic, filename, NULL, 0, ap); |
|
|
|
if (ret < 0) { |
|
|
|
if (ret < 0) { |
|
|
|
fprintf(stderr, "cannot open %s\n", filename); |
|
|
|
fprintf(stderr, "cannot open %s\n", filename); |
|
|
@ -132,5 +125,7 @@ int main(int argc, char **argv) |
|
|
|
printf("ret:%-10s st:%2d flags:%d ts:%s\n", ret_str(ret), stream_id, i&1, ts_buf); |
|
|
|
printf("ret:%-10s st:%2d flags:%d ts:%s\n", ret_str(ret), stream_id, i&1, ts_buf); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
av_close_input_file(ic); |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|