| 106 | } |
| 107 | |
| 108 | int main(int argc, char **argv) |
| 109 | { |
| 110 | const char *outfilename = NULL; |
| 111 | const char *infilename = NULL; |
| 112 | FILE *outfile = NULL; |
| 113 | FILE *infile = NULL; |
| 114 | char *graph_string = NULL; |
| 115 | AVFilterGraph *graph = NULL; |
| 116 | int c; |
| 117 | |
| 118 | av_log_set_level(AV_LOG_DEBUG); |
| 119 | |
| 120 | while ((c = getopt(argc, argv, "hi:o:")) != -1) { |
| 121 | switch (c) { |
| 122 | case 'h': |
| 123 | usage(); |
| 124 | return 0; |
| 125 | case 'i': |
| 126 | infilename = optarg; |
| 127 | break; |
| 128 | case 'o': |
| 129 | outfilename = optarg; |
| 130 | break; |
| 131 | case '?': |
| 132 | return 1; |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | if (!infilename || !strcmp(infilename, "-")) |
| 137 | infilename = "/dev/stdin"; |
| 138 | infile = fopen(infilename, "r"); |
| 139 | if (!infile) { |
| 140 | fprintf(stderr, "Failed to open input file '%s': %s\n", |
| 141 | infilename, strerror(errno)); |
| 142 | return 1; |
| 143 | } |
| 144 | |
| 145 | if (!outfilename || !strcmp(outfilename, "-")) |
| 146 | outfilename = "/dev/stdout"; |
| 147 | outfile = fopen(outfilename, "w"); |
| 148 | if (!outfile) { |
| 149 | fprintf(stderr, "Failed to open output file '%s': %s\n", |
| 150 | outfilename, strerror(errno)); |
| 151 | return 1; |
| 152 | } |
| 153 | |
| 154 | /* read from infile and put it in a buffer */ |
| 155 | { |
| 156 | int64_t count = 0; |
| 157 | struct line *line, *last_line, *first_line; |
| 158 | char *p; |
| 159 | last_line = first_line = av_malloc(sizeof(struct line)); |
| 160 | if (!last_line) { |
| 161 | fprintf(stderr, "Memory allocation failure\n"); |
| 162 | return 1; |
| 163 | } |
| 164 | |
| 165 | while (fgets(last_line->data, sizeof(last_line->data), infile)) { |
nothing calls this directly
no test coverage detected