MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / main

Function main

fftools/ffplay.c:3838–3976  ·  view source on GitHub ↗

Called from the main */

Source from the content-addressed store, hash-verified

3836
3837/* Called from the main */
3838int 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;

Callers

nothing calls this directly

Calls 15

init_dynloadFunction · 0.85
av_log_set_flagsFunction · 0.85
parse_loglevelFunction · 0.85
avdevice_register_allFunction · 0.85
avformat_network_initFunction · 0.85
show_bannerFunction · 0.85
av_logFunction · 0.85
vk_get_rendererFunction · 0.85
do_exitFunction · 0.85
av_dict_parse_stringFunction · 0.85
vk_renderer_createFunction · 0.85
av_dict_freeFunction · 0.85

Tested by

no test coverage detected