提交 80068da3 编写于 作者: M Martin Storsjö

avoptions: Return explicitly NAN or {0,0} if the option isn't found

This actually matches what av_get_double did earlier, the
0.0/0.0 division was intentional, for producing NAN.

Still keeping the check for the return value from
av_get_number, for clarity.
Signed-off-by: NMartin Storsjö <martin@martin.st>
上级 48b1fb13
......@@ -291,7 +291,7 @@ double av_get_double(void *obj, const char *name, const AVOption **o_out)
int den=1;
if (av_get_number(obj, name, o_out, &num, &den, &intnum) < 0)
return -1;
return NAN;
return num*intnum/den;
}
......@@ -302,7 +302,7 @@ AVRational av_get_q(void *obj, const char *name, const AVOption **o_out)
int den=1;
if (av_get_number(obj, name, o_out, &num, &den, &intnum) < 0)
return (AVRational){-1, 0};
return (AVRational){0, 0};
if (num == 1.0 && (int)intnum == intnum)
return (AVRational){intnum, den};
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册