| 144 | } |
| 145 | |
| 146 | static int write_fragment(const char *filename, AVIOContext *in) |
| 147 | { |
| 148 | AVIOContext *out = NULL; |
| 149 | int ret; |
| 150 | |
| 151 | if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, NULL, NULL)) < 0) { |
| 152 | fprintf(stderr, "Unable to open %s: %s\n", filename, av_err2str(ret)); |
| 153 | return ret; |
| 154 | } |
| 155 | ret = copy_tag(in, out, MKBETAG('m', 'o', 'o', 'f')); |
| 156 | if (!ret) |
| 157 | ret = copy_tag(in, out, MKBETAG('m', 'd', 'a', 't')); |
| 158 | |
| 159 | avio_flush(out); |
| 160 | avio_close(out); |
| 161 | |
| 162 | return ret; |
| 163 | } |
| 164 | |
| 165 | static int skip_fragment(AVIOContext *in) |
| 166 | { |
no test coverage detected