[FFmpeg-devel] [PATCH 1/3] lavu/opt: accept NULL and "none" as frame rates

Rodger Combs rodger.combs at gmail.com
Tue Apr 19 08:28:01 CEST 2016


---
 libavutil/opt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index eae4f75..83093e0 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -275,11 +275,12 @@ static int set_string_image_size(void *obj, const AVOption *o, const char *val,
 static int set_string_video_rate(void *obj, const AVOption *o, const char *val, AVRational *dst)
 {
     int ret;
-    if (!val) {
-        ret = AVERROR(EINVAL);
-    } else {
-        ret = av_parse_video_rate(dst, val);
+    if (!val || !strcmp(val, "none")) {
+        dst->num =
+        dst->den = 0;
+        return 0;
     }
+    ret = av_parse_video_rate(dst, val);
     if (ret < 0)
         av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\" as video rate\n", val);
     return ret;
-- 
2.7.3



More information about the ffmpeg-devel mailing list