lavfi/setpts: set SAMPLE_RATE to NAN when input is no audio
authorStefano Sabatini <stefasab@gmail.com>
Mon, 10 Sep 2012 10:02:30 +0000 (12:02 +0200)
committerStefano Sabatini <stefasab@gmail.com>
Mon, 10 Sep 2012 16:52:28 +0000 (18:52 +0200)
Should be more robust/consistent.

libavfilter/f_setpts.c
libavfilter/version.h

index 6227fe02a40102454a001ccc20f4cef7d378cebd..023dc1e67288ea9950d036e07e49b0e551241d67 100644 (file)
@@ -106,8 +106,8 @@ static int config_input(AVFilterLink *inlink)
     setpts->type = inlink->type;
     setpts->var_values[VAR_TB] = av_q2d(inlink->time_base);
 
-    if (setpts->type == AVMEDIA_TYPE_AUDIO)
-        setpts->var_values[VAR_SAMPLE_RATE] = inlink->sample_rate;
+    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 && inlink->frame_rate.den ?
         av_q2d(inlink->frame_rate) : NAN;
index 9d96d77cb18d9d7a9b949b78f482cf202a08c905..5f642282b324be164b5a82843438e52e103eebae 100644 (file)
@@ -30,7 +30,7 @@
 
 #define LIBAVFILTER_VERSION_MAJOR  3
 #define LIBAVFILTER_VERSION_MINOR  16
-#define LIBAVFILTER_VERSION_MICRO 102
+#define LIBAVFILTER_VERSION_MICRO 103
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
                                                LIBAVFILTER_VERSION_MINOR, \