avtextwriter_create_file() creates an AVIOContext whose pointer resides in its private context. If it were not always closed on uninit, the AVIOContext would leak, so it makes no sense to have this parameter.
Unified · Split
| @@ -3161,7 +3161,7 @@ int main(int argc, char **argv) · 3160 unmodified lines | ||
| 3161 | 3161 | } |
| 3162 | 3162 | |
| 3163 | 3163 | if (output_filename) { |
| 3164 | − ret = avtextwriter_create_file(&wctx, output_filename, 1); | |
| 3164 | + ret = avtextwriter_create_file(&wctx, output_filename); | |
| 3165 | 3165 | } else |
| 3166 | 3166 | ret = avtextwriter_create_stdout(&wctx); |
| 3167 | 3167 | |
| @@ -61,7 +61,7 @@ int avtextwriter_create_stdout(AVTextWriterContext **pwctx); · 60 unmodified lines | ||
| 61 | 61 | |
| 62 | 62 | int avtextwriter_create_avio(AVTextWriterContext **pwctx, AVIOContext *avio_ctx, int close_on_uninit); |
| 63 | 63 | |
| 64 | −int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename, int close_on_uninit); | |
| 64 | +int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename); | |
| 65 | 65 | |
| 66 | 66 | int avtextwriter_create_buffer(AVTextWriterContext **pwctx, AVBPrint *buffer); |
| 67 | 67 | |
| @@ -76,7 +76,7 @@ const AVTextWriter avtextwriter_avio = { · 75 unmodified lines | ||
| 76 | 76 | .writer_w8 = io_w8 |
| 77 | 77 | }; |
| 78 | 78 | |
| 79 | −int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename, int close_on_uninit) | |
| 79 | +int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename) | |
| 80 | 80 | { |
| 81 | 81 | IOWriterContext *ctx; |
| 82 | 82 | int ret; |
| @@ -95,7 +95,7 @@ int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_fil · 12 unmodified lines | ||
| 95 | 95 | return ret; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | − ctx->close_on_uninit = close_on_uninit; | |
| 98 | + ctx->close_on_uninit = 1; | |
| 99 | 99 | |
| 100 | 100 | return ret; |
| 101 | 101 | } |