| 312 | const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL }; |
| 313 | |
| 314 | static void ffmpeg_cleanup(int ret) |
| 315 | { |
| 316 | if ((print_graphs || print_graphs_file) && nb_output_files > 0) |
| 317 | print_filtergraphs(filtergraphs, nb_filtergraphs, input_files, nb_input_files, output_files, nb_output_files); |
| 318 | |
| 319 | if (do_benchmark) { |
| 320 | int64_t maxrss = getmaxrss() / 1024; |
| 321 | av_log(NULL, AV_LOG_INFO, "bench: maxrss=%"PRId64"KiB\n", maxrss); |
| 322 | } |
| 323 | |
| 324 | for (int i = 0; i < nb_filtergraphs; i++) |
| 325 | fg_free(&filtergraphs[i]); |
| 326 | av_freep(&filtergraphs); |
| 327 | |
| 328 | for (int i = 0; i < nb_output_files; i++) |
| 329 | of_free(&output_files[i]); |
| 330 | |
| 331 | for (int i = 0; i < nb_input_files; i++) |
| 332 | ifile_close(&input_files[i]); |
| 333 | |
| 334 | for (int i = 0; i < nb_decoders; i++) |
| 335 | dec_free(&decoders[i]); |
| 336 | av_freep(&decoders); |
| 337 | |
| 338 | if (vstats_file) { |
| 339 | if (fclose(vstats_file)) |
| 340 | av_log(NULL, AV_LOG_ERROR, |
| 341 | "Error closing vstats file, loss of information possible: %s\n", |
| 342 | av_err2str(AVERROR(errno))); |
| 343 | } |
| 344 | av_freep(&vstats_filename); |
| 345 | of_enc_stats_close(); |
| 346 | |
| 347 | hw_device_free_all(); |
| 348 | |
| 349 | av_freep(&filter_nbthreads); |
| 350 | |
| 351 | av_freep(&print_graphs_file); |
| 352 | av_freep(&print_graphs_format); |
| 353 | |
| 354 | av_freep(&input_files); |
| 355 | av_freep(&output_files); |
| 356 | |
| 357 | uninit_opts(); |
| 358 | |
| 359 | avformat_network_deinit(); |
| 360 | |
| 361 | if (received_sigterm) { |
| 362 | av_log(NULL, AV_LOG_INFO, "Exiting normally, received signal %d.\n", |
| 363 | (int) received_sigterm); |
| 364 | } else if (ret && atomic_load(&transcode_init_done)) { |
| 365 | av_log(NULL, AV_LOG_INFO, "Conversion failed!\n"); |
| 366 | } |
| 367 | term_exit(); |
| 368 | ffmpeg_exited = 1; |
| 369 | } |
| 370 | |
| 371 | OutputStream *ost_iter(OutputStream *prev) |
no test coverage detected