Unified · Split
| @@ -132,9 +132,16 @@ static int open_file(AVFormatContext *avf, unsigned fileno) · 131 unmodified lines | ||
| 132 | 132 | |
| 133 | 133 | if (cat->avf) |
| 134 | 134 | avformat_close_input(&cat->avf); |
| 135 | + | |
| 136 | + cat->avf = avformat_alloc_context(); | |
| 137 | + if (!cat->avf) | |
| 138 | + return AVERROR(ENOMEM); | |
| 139 | + | |
| 140 | + cat->avf->interrupt_callback = avf->interrupt_callback; | |
| 135 | 141 | if ((ret = avformat_open_input(&cat->avf, file->url, NULL, NULL)) < 0 || |
| 136 | 142 | (ret = avformat_find_stream_info(cat->avf, NULL)) < 0) { |
| 137 | 143 | av_log(avf, AV_LOG_ERROR, "Impossible to open '%s'\n", file->url); |
| 144 | + avformat_close_input(&cat->avf); | |
| 138 | 145 | return ret; |
| 139 | 146 | } |
| 140 | 147 | cat->cur_file = file; |