Calling the init function will become mandatory at some later point. By calling it, more heavy network init (such as SSL/TLS library init) can be done once at startup, instead of implicitly when used (which could lead to it being done a number of times).
Unified · Split
| @@ -542,6 +542,7 @@ void exit_program(int ret) · 541 unmodified lines | |||
| 542 | #if CONFIG_AVFILTER | 542 | #if CONFIG_AVFILTER |
| 543 | avfilter_uninit(); | 543 | avfilter_uninit(); |
| 544 | #endif | 544 | #endif |
| 545 | avformat_network_deinit(); | ||
| 545 | 546 | ||
| 546 | if (received_sigterm) { | 547 | if (received_sigterm) { |
| 547 | av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n", | 548 | av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n", |
| @@ -4218,6 +4219,7 @@ int main(int argc, char **argv) · 3670 unmodified lines | |||
| 4218 | avfilter_register_all(); | 4219 | avfilter_register_all(); |
| 4219 | #endif | 4220 | #endif |
| 4220 | av_register_all(); | 4221 | av_register_all(); |
| 4222 | avformat_network_init(); | ||
| 4221 | 4223 | ||
| 4222 | avio_set_interrupt_cb(decode_interrupt_cb); | 4224 | avio_set_interrupt_cb(decode_interrupt_cb); |
| 4223 | 4225 | ||
| @@ -1259,6 +1259,7 @@ static void do_exit(void) · 1258 unmodified lines | |||
| 1259 | #if CONFIG_AVFILTER | 1259 | #if CONFIG_AVFILTER |
| 1260 | avfilter_uninit(); | 1260 | avfilter_uninit(); |
| 1261 | #endif | 1261 | #endif |
| 1262 | avformat_network_deinit(); | ||
| 1262 | if (show_status) | 1263 | if (show_status) |
| 1263 | printf("\n"); | 1264 | printf("\n"); |
| 1264 | SDL_Quit(); | 1265 | SDL_Quit(); |
| @@ -3066,6 +3067,7 @@ int main(int argc, char **argv) · 1801 unmodified lines | |||
| 3066 | avfilter_register_all(); | 3067 | avfilter_register_all(); |
| 3067 | #endif | 3068 | #endif |
| 3068 | av_register_all(); | 3069 | av_register_all(); |
| 3070 | avformat_network_init(); | ||
| 3069 | 3071 | ||
| 3070 | init_opts(); | 3072 | init_opts(); |
| 3071 | 3073 | ||
| @@ -399,6 +399,7 @@ int main(int argc, char **argv) · 398 unmodified lines | |||
| 399 | 399 | ||
| 400 | parse_loglevel(argc, argv, options); | 400 | parse_loglevel(argc, argv, options); |
| 401 | av_register_all(); | 401 | av_register_all(); |
| 402 | avformat_network_init(); | ||
| 402 | init_opts(); | 403 | init_opts(); |
| 403 | #if CONFIG_AVDEVICE | 404 | #if CONFIG_AVDEVICE |
| 404 | avdevice_register_all(); | 405 | avdevice_register_all(); |
| @@ -416,5 +417,7 @@ int main(int argc, char **argv) · 11 unmodified lines | |||
| 416 | 417 | ||
| 417 | ret = probe_file(input_filename); | 418 | ret = probe_file(input_filename); |
| 418 | 419 | ||
| 420 | avformat_network_deinit(); | ||
| 421 | |||
| 419 | return ret; | 422 | return ret; |
| 420 | } | 423 | } |
| @@ -4670,6 +4670,7 @@ int main(int argc, char **argv) · 4669 unmodified lines | |||
| 4670 | 4670 | ||
| 4671 | parse_loglevel(argc, argv, options); | 4671 | parse_loglevel(argc, argv, options); |
| 4672 | av_register_all(); | 4672 | av_register_all(); |
| 4673 | avformat_network_init(); | ||
| 4673 | 4674 | ||
| 4674 | show_banner(); | 4675 | show_banner(); |
| 4675 | 4676 | ||
| @@ -493,6 +493,7 @@ void exit_program(int ret) · 492 unmodified lines | |||
| 493 | #if CONFIG_AVFILTER | 493 | #if CONFIG_AVFILTER |
| 494 | avfilter_uninit(); | 494 | avfilter_uninit(); |
| 495 | #endif | 495 | #endif |
| 496 | avformat_network_deinit(); | ||
| 496 | 497 | ||
| 497 | if (received_sigterm) { | 498 | if (received_sigterm) { |
| 498 | fprintf(stderr, | 499 | fprintf(stderr, |
| @@ -4367,6 +4368,7 @@ int main(int argc, char **argv) · 3868 unmodified lines | |||
| 4367 | avfilter_register_all(); | 4368 | avfilter_register_all(); |
| 4368 | #endif | 4369 | #endif |
| 4369 | av_register_all(); | 4370 | av_register_all(); |
| 4371 | avformat_network_init(); | ||
| 4370 | 4372 | ||
| 4371 | avio_set_interrupt_cb(decode_interrupt_cb); | 4373 | avio_set_interrupt_cb(decode_interrupt_cb); |
| 4372 | 4374 | ||