Called from the main */
| 3836 | |
| 3837 | /* Called from the main */ |
| 3838 | int main(int argc, char **argv) |
| 3839 | { |
| 3840 | int flags, ret; |
| 3841 | VideoState *is; |
| 3842 | |
| 3843 | init_dynload(); |
| 3844 | |
| 3845 | av_log_set_flags(AV_LOG_SKIP_REPEATED); |
| 3846 | parse_loglevel(argc, argv, options); |
| 3847 | |
| 3848 | /* register all codecs, demux and protocols */ |
| 3849 | #if CONFIG_AVDEVICE |
| 3850 | avdevice_register_all(); |
| 3851 | #endif |
| 3852 | avformat_network_init(); |
| 3853 | |
| 3854 | signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */ |
| 3855 | signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */ |
| 3856 | |
| 3857 | show_banner(argc, argv, options); |
| 3858 | |
| 3859 | ret = parse_options(NULL, argc, argv, options, opt_input_file); |
| 3860 | if (ret < 0) |
| 3861 | exit(ret == AVERROR_EXIT ? 0 : 1); |
| 3862 | |
| 3863 | if (!input_filename) { |
| 3864 | show_usage(); |
| 3865 | av_log(NULL, AV_LOG_FATAL, "An input file must be specified\n"); |
| 3866 | av_log(NULL, AV_LOG_FATAL, |
| 3867 | "Use -h to get full help or, even better, run 'man %s'\n", program_name); |
| 3868 | exit(1); |
| 3869 | } |
| 3870 | |
| 3871 | if (display_disable) { |
| 3872 | video_disable = 1; |
| 3873 | } |
| 3874 | flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER; |
| 3875 | if (audio_disable) |
| 3876 | flags &= ~SDL_INIT_AUDIO; |
| 3877 | else { |
| 3878 | /* Try to work around an occasional ALSA buffer underflow issue when the |
| 3879 | * period size is NPOT due to ALSA resampling by forcing the buffer size. */ |
| 3880 | if (!SDL_getenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE")) |
| 3881 | SDL_setenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE","1", 1); |
| 3882 | } |
| 3883 | if (display_disable) |
| 3884 | flags &= ~SDL_INIT_VIDEO; |
| 3885 | if (SDL_Init (flags)) { |
| 3886 | av_log(NULL, AV_LOG_FATAL, "Could not initialize SDL - %s\n", SDL_GetError()); |
| 3887 | av_log(NULL, AV_LOG_FATAL, "(Did you set the DISPLAY variable?)\n"); |
| 3888 | exit(1); |
| 3889 | } |
| 3890 | |
| 3891 | SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE); |
| 3892 | SDL_EventState(SDL_USEREVENT, SDL_IGNORE); |
| 3893 | |
| 3894 | if (!display_disable) { |
| 3895 | int flags = SDL_WINDOW_HIDDEN; |
nothing calls this directly
no test coverage detected