]> git.sesse.net Git - ffmpeg/commitdiff
avutil/spherical: Use av_strstart instead of strncmp
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 24 Feb 2021 02:37:26 +0000 (03:37 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 28 Feb 2021 16:14:21 +0000 (17:14 +0100)
It makes the intent clearer and avoids calculating the length
separately.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavutil/spherical.c

index 4a7f3e49ca729e45841afd90d7076c671b46ce90..ed66344a2fd21d272ea898bba6a37172df38b660 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "avstring.h"
 #include "mem.h"
 #include "spherical.h"
 
@@ -70,8 +71,7 @@ int av_spherical_from_name(const char *name)
     int i;
 
     for (i = 0; i < FF_ARRAY_ELEMS(spherical_projection_names); i++) {
-        size_t len = strlen(spherical_projection_names[i]);
-        if (!strncmp(spherical_projection_names[i], name, len))
+        if (av_strstart(name, spherical_projection_names[i], NULL))
             return i;
     }