X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fsetpts.c;h=800ba6a83fcf7e8e20f98029a5a595ce41e4488f;hb=936d18fb42bb1776f1b25e16b9d6a72846ee33ac;hp=4505498bf3488e4c5973bafe91c04eda733aff9a;hpb=217ad40aef9eeeff4e805dec3e980fb16aec3345;p=ffmpeg diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c index 4505498bf34..800ba6a83fc 100644 --- a/libavfilter/setpts.c +++ b/libavfilter/setpts.c @@ -57,6 +57,7 @@ static const char *const var_names[] = { "RTCSTART", ///< wallclock (RTC) time at the start of the movie in micro seconds "S", // Number of samples in the current frame "SR", // Audio sample rate + "FR", ///< defined only for constant frame-rate video NULL }; @@ -81,6 +82,7 @@ enum var_name { VAR_RTCSTART, VAR_S, VAR_SR, + VAR_FR, VAR_VARS_NB }; @@ -127,7 +129,8 @@ static int config_input(AVFilterLink *inlink) setpts->var_values[VAR_SAMPLE_RATE] = setpts->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN; - setpts->var_values[VAR_FRAME_RATE] = inlink->frame_rate.num && + setpts->var_values[VAR_FRAME_RATE] = + setpts->var_values[VAR_FR] = inlink->frame_rate.num && inlink->frame_rate.den ? av_q2d(inlink->frame_rate) : NAN;