Newer
Older
Michel Bardiaux
committed
"mouse click seek to percentage in file corresponding to fraction of width\n"
Diego Pettenò
committed
static void opt_input_file(const char *filename)
if (input_filename) {
fprintf(stderr, "Argument '%s' provided as input filename, but '%s' was already specified.\n",
filename, input_filename);
exit(1);
}
Michael Niedermayer
committed
if (!strcmp(filename, "-"))
input_filename = filename;
}
/* Called from the main */
int main(int argc, char **argv)
{
int flags;
av_log_set_flags(AV_LOG_SKIP_REPEATED);
#if CONFIG_AVDEVICE
#endif
#if CONFIG_AVFILTER
avfilter_register_all();
#endif
init_opts();
show_banner();
parse_options(argc, argv, options, opt_input_file);
if (!input_filename) {
fprintf(stderr, "An input file must be specified\n");
fprintf(stderr, "Use -h to get full help or, even better, run 'man ffplay'\n");
if (display_disable) {
video_disable = 1;
}
flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER;
#if !defined(__MINGW32__) && !defined(__APPLE__)
flags |= SDL_INIT_EVENTTHREAD; /* Not supported on Windows or Mac OS X */
fprintf(stderr, "Could not initialize SDL - %s\n", SDL_GetError());
exit(1);
}
if (!display_disable) {
#if HAVE_SDL_VIDEO_SIZE
const SDL_VideoInfo *vi = SDL_GetVideoInfo();
fs_screen_width = vi->current_w;
fs_screen_height = vi->current_h;
#endif
}
SDL_EventState(SDL_ACTIVEEVENT, SDL_IGNORE);
SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE);
SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
av_init_packet(&flush_pkt);
flush_pkt.data= "FLUSH";
Fabrice Bellard
committed
cur_stream = stream_open(input_filename, file_iformat);
event_loop();
/* never returns */
return 0;
}