Commit c71e1e60 authored by Gyan Doshi's avatar Gyan Doshi

avfilter/setpts: add FR shorthand for FRAME_RATE

parent 115b7c96
...@@ -19392,7 +19392,7 @@ The expression is evaluated through the eval API and can contain the following ...@@ -19392,7 +19392,7 @@ The expression is evaluated through the eval API and can contain the following
constants: constants:
@table @option @table @option
@item FRAME_RATE @item FRAME_RATE, FR
frame rate, only defined for constant frame-rate video frame rate, only defined for constant frame-rate video
@item PTS @item PTS
......
...@@ -57,6 +57,7 @@ static const char *const var_names[] = { ...@@ -57,6 +57,7 @@ static const char *const var_names[] = {
"RTCSTART", ///< wallclock (RTC) time at the start of the movie in micro seconds "RTCSTART", ///< wallclock (RTC) time at the start of the movie in micro seconds
"S", // Number of samples in the current frame "S", // Number of samples in the current frame
"SR", // Audio sample rate "SR", // Audio sample rate
"FR", ///< defined only for constant frame-rate video
NULL NULL
}; };
...@@ -81,6 +82,7 @@ enum var_name { ...@@ -81,6 +82,7 @@ enum var_name {
VAR_RTCSTART, VAR_RTCSTART,
VAR_S, VAR_S,
VAR_SR, VAR_SR,
VAR_FR,
VAR_VARS_NB VAR_VARS_NB
}; };
...@@ -127,7 +129,8 @@ static int config_input(AVFilterLink *inlink) ...@@ -127,7 +129,8 @@ static int config_input(AVFilterLink *inlink)
setpts->var_values[VAR_SAMPLE_RATE] = setpts->var_values[VAR_SAMPLE_RATE] =
setpts->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN; 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 ? inlink->frame_rate.den ?
av_q2d(inlink->frame_rate) : NAN; av_q2d(inlink->frame_rate) : NAN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment