avutil/display: use hypot().

This commit is contained in:
Clément Bœsch 2014-05-20 19:51:03 +02:00
parent 584327f22f
commit fa972dcf1a
1 changed files with 2 additions and 4 deletions

View File

@ -35,10 +35,8 @@ double av_display_rotation_get(const int32_t matrix[9])
{
double rotation, scale[2];
scale[0] = sqrt(CONV_FP(matrix[0]) * CONV_FP(matrix[0]) +
CONV_FP(matrix[3]) * CONV_FP(matrix[3]));
scale[1] = sqrt(CONV_FP(matrix[1]) * CONV_FP(matrix[1]) +
CONV_FP(matrix[4]) * CONV_FP(matrix[4]));
scale[0] = hypot(CONV_FP(matrix[0]), CONV_FP(matrix[3]));
scale[1] = hypot(CONV_FP(matrix[1]), CONV_FP(matrix[4]));
if (scale[0] == 0.0 || scale[1] == 0.0)
return NAN;