]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/setpts: add FR shorthand for FRAME_RATE
authorGyan Doshi <ffmpeg@gyani.pro>
Thu, 5 Jul 2018 09:54:55 +0000 (15:24 +0530)
committerGyan Doshi <ffmpeg@gyani.pro>
Sat, 7 Jul 2018 15:38:08 +0000 (21:08 +0530)
doc/filters.texi
libavfilter/setpts.c

index 3e668703ae35c19256725439a908a68e44252d62..d236bd69b7bf5855f4c87c1868ac68b211a579df 100644 (file)
@@ -19392,7 +19392,7 @@ The expression is evaluated through the eval API and can contain the following
 constants:
 
 @table @option
-@item FRAME_RATE
+@item FRAME_RATE, FR
 frame rate, only defined for constant frame-rate video
 
 @item PTS
index 4505498bf3488e4c5973bafe91c04eda733aff9a..800ba6a83fcf7e8e20f98029a5a595ce41e4488f 100644 (file)
@@ -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;