History

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).

Martin Storsjö committed 15 years ago

Commit 776f2bb1 parent 3607ed75 files · +10 −0Browse files

Unified · Split

5 files
  1. avconv.c +2 −0
  2. avplay.c +2 −0
  3. avprobe.c +3 −0
  4. avserver.c +1 −0
  5. ffmpeg.c +2 −0
avconv.c+2−0
@@ -542,6 +542,7 @@ void exit_program(int ret) · 541 unmodified lines
542#if CONFIG_AVFILTER542#if CONFIG_AVFILTER
543 avfilter_uninit();543 avfilter_uninit();
544#endif544#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#endif4220#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
avplay.c+2−0
@@ -1259,6 +1259,7 @@ static void do_exit(void) · 1258 unmodified lines
1259#if CONFIG_AVFILTER1259#if CONFIG_AVFILTER
1260 avfilter_uninit();1260 avfilter_uninit();
1261#endif1261#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#endif3068#endif
3068 av_register_all();3069 av_register_all();
3070 avformat_network_init();
3069 3071
3070 init_opts();3072 init_opts();
3071 3073
avprobe.c+3−0
@@ -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_AVDEVICE404#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}
avserver.c+1−0
@@ -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
ffmpeg.c+2−0
@@ -493,6 +493,7 @@ void exit_program(int ret) · 492 unmodified lines
493#if CONFIG_AVFILTER493#if CONFIG_AVFILTER
494 avfilter_uninit();494 avfilter_uninit();
495#endif495#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#endif4369#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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t