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

Function parse_and_set_vsync

fftools/ffmpeg_opt.c:362–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362int parse_and_set_vsync(const char *arg, enum VideoSyncMethod *vsync_var, int file_idx, int st_idx, int is_global)
363{
364 if (!av_strcasecmp(arg, "cfr")) *vsync_var = VSYNC_CFR;
365 else if (!av_strcasecmp(arg, "vfr")) *vsync_var = VSYNC_VFR;
366 else if (!av_strcasecmp(arg, "passthrough")) *vsync_var = VSYNC_PASSTHROUGH;
367#if FFMPEG_OPT_VSYNC_DROP
368 else if (!av_strcasecmp(arg, "drop")) {
369 av_log(NULL, AV_LOG_WARNING, "-vsync/fps_mode drop is deprecated\n");
370 *vsync_var = VSYNC_DROP;
371 }
372#endif
373 else if (!is_global && !av_strcasecmp(arg, "auto")) *vsync_var = VSYNC_AUTO;
374 else if (!is_global) {
375 av_log(NULL, AV_LOG_FATAL, "Invalid value %s specified for fps_mode of #%d:%d.\n", arg, file_idx, st_idx);
376 return AVERROR(EINVAL);
377 }
378
379#if FFMPEG_OPT_VSYNC
380 if (is_global && *vsync_var == VSYNC_AUTO) {
381 int ret;
382 double num;
383
384 ret = parse_number("vsync", arg, OPT_TYPE_INT, VSYNC_AUTO, VSYNC_VFR, &num);
385 if (ret < 0)
386 return ret;
387
388 video_sync_method = num;
389 av_log(NULL, AV_LOG_WARNING, "Passing a number to -vsync is deprecated,"
390 " use a string argument as described in the manual.\n");
391 }
392#endif
393
394 return 0;
395}
396
397/* Correct input file start times based on enabled streams */
398static void correct_input_start_times(void)

Callers 2

opt_vsyncFunction · 0.85
new_stream_videoFunction · 0.85

Calls 3

av_strcasecmpFunction · 0.85
av_logFunction · 0.85
parse_numberFunction · 0.85

Tested by

no test coverage detected