Rev 3068 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3068 | Rev 3248 | ||
---|---|---|---|
Line 59... | Line 59... | ||
59 | 59 | ||
60 | int main( int argc, char *argv[]) |
60 | int main( int argc, char *argv[]) |
61 | { |
61 | { |
- | 62 | int i; |
|
Line 62... | Line 63... | ||
62 | int i; |
63 | char *file_name, *dot; |
- | 64 | ||
- | 65 | if(argc < 2) |
|
- | 66 | { |
|
- | 67 | movie_file = get_moviefile(); |
|
63 | 68 | if(movie_file == NULL) |
|
64 | if(argc < 2) { |
69 | { |
65 | printf("Please provide a movie file\n"); |
70 | printf("Please provide a movie file\n"); |
66 | return -1; |
71 | return -1; |
67 | } |
72 | } |
68 | 73 | } |
|
Line 69... | Line 74... | ||
69 | movie_file = argv[1]; |
74 | else movie_file = argv[1]; |
Line 70... | Line 75... | ||
70 | /* register all codecs, demux and protocols */ |
75 | /* register all codecs, demux and protocols */ |
71 | 76 | ||
72 | av_log_set_level(AV_LOG_FATAL); |
77 | av_log_set_level(AV_LOG_FATAL); |
Line 73... | Line 78... | ||
73 | 78 | ||
74 | avcodec_register_all(); |
79 | avcodec_register_all(); |
75 | avdevice_register_all(); |
80 | avdevice_register_all(); |
76 | av_register_all(); |
81 | av_register_all(); |
77 | 82 | ||
Line 78... | Line 83... | ||
78 | if( avformat_open_input(&pFormatCtx, argv[1], NULL, NULL) < 0) |
83 | if( avformat_open_input(&pFormatCtx, movie_file, NULL, NULL) < 0) |
Line 89... | Line 94... | ||
89 | printf("Cannot find streams\n\r"); |
94 | printf("Cannot find streams\n\r"); |
90 | return -1; |
95 | return -1; |
91 | }; |
96 | }; |
92 | 97 | ||
Line -... | Line 98... | ||
- | 98 | file_name = strrchr(movie_file,'/')+1; |
|
- | 99 | dot = strrchr(file_name,'.'); |
|
- | 100 | if(dot) |
|
- | 101 | { |
|
- | 102 | movie_file = malloc(dot-file_name+1); |
|
- | 103 | memcpy(movie_file, file_name, dot-file_name); |
|
- | 104 | movie_file[dot-file_name] = 0; |
|
- | 105 | } |
|
- | 106 | else movie_file = file_name; |
|
- | 107 | ||
- | 108 | ||
93 | // __asm__ __volatile__("int3"); |
109 | // __asm__ __volatile__("int3"); |
Line 94... | Line 110... | ||
94 | 110 | ||
Line 95... | Line 111... | ||
95 | // dump_format(pFormatCtx, 0, argv[1], 0); |
111 | // dump_format(pFormatCtx, 0, argv[1], 0); |