Commit 776f2bb9 authored by Martin Storsjö's avatar Martin Storsjö

Call avformat_network_init/deinit in the programs

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).
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 3607ed70
...@@ -542,6 +542,7 @@ void exit_program(int ret) ...@@ -542,6 +542,7 @@ void exit_program(int ret)
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
avfilter_uninit(); avfilter_uninit();
#endif #endif
avformat_network_deinit();
if (received_sigterm) { if (received_sigterm) {
av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n", av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
...@@ -4218,6 +4219,7 @@ int main(int argc, char **argv) ...@@ -4218,6 +4219,7 @@ int main(int argc, char **argv)
avfilter_register_all(); avfilter_register_all();
#endif #endif
av_register_all(); av_register_all();
avformat_network_init();
avio_set_interrupt_cb(decode_interrupt_cb); avio_set_interrupt_cb(decode_interrupt_cb);
......
...@@ -1259,6 +1259,7 @@ static void do_exit(void) ...@@ -1259,6 +1259,7 @@ static void do_exit(void)
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
avfilter_uninit(); avfilter_uninit();
#endif #endif
avformat_network_deinit();
if (show_status) if (show_status)
printf("\n"); printf("\n");
SDL_Quit(); SDL_Quit();
...@@ -3066,6 +3067,7 @@ int main(int argc, char **argv) ...@@ -3066,6 +3067,7 @@ int main(int argc, char **argv)
avfilter_register_all(); avfilter_register_all();
#endif #endif
av_register_all(); av_register_all();
avformat_network_init();
init_opts(); init_opts();
......
...@@ -399,6 +399,7 @@ int main(int argc, char **argv) ...@@ -399,6 +399,7 @@ int main(int argc, char **argv)
parse_loglevel(argc, argv, options); parse_loglevel(argc, argv, options);
av_register_all(); av_register_all();
avformat_network_init();
init_opts(); init_opts();
#if CONFIG_AVDEVICE #if CONFIG_AVDEVICE
avdevice_register_all(); avdevice_register_all();
...@@ -416,5 +417,7 @@ int main(int argc, char **argv) ...@@ -416,5 +417,7 @@ int main(int argc, char **argv)
ret = probe_file(input_filename); ret = probe_file(input_filename);
avformat_network_deinit();
return ret; return ret;
} }
...@@ -4670,6 +4670,7 @@ int main(int argc, char **argv) ...@@ -4670,6 +4670,7 @@ int main(int argc, char **argv)
parse_loglevel(argc, argv, options); parse_loglevel(argc, argv, options);
av_register_all(); av_register_all();
avformat_network_init();
show_banner(); show_banner();
......
...@@ -493,6 +493,7 @@ void exit_program(int ret) ...@@ -493,6 +493,7 @@ void exit_program(int ret)
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
avfilter_uninit(); avfilter_uninit();
#endif #endif
avformat_network_deinit();
if (received_sigterm) { if (received_sigterm) {
fprintf(stderr, fprintf(stderr,
...@@ -4367,6 +4368,7 @@ int main(int argc, char **argv) ...@@ -4367,6 +4368,7 @@ int main(int argc, char **argv)
avfilter_register_all(); avfilter_register_all();
#endif #endif
av_register_all(); av_register_all();
avformat_network_init();
avio_set_interrupt_cb(decode_interrupt_cb); avio_set_interrupt_cb(decode_interrupt_cb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment