]> git.sesse.net Git - ffmpeg/commitdiff
avutil/stereo3d: Use av_strstart instead of strncmp
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 24 Feb 2021 02:34:15 +0000 (03:34 +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/stereo3d.c

index 6edcdb17967684e107bd7151613c323d1f1fc29f..279fcc1ff3e373c8821619ca8caad721e7c5c956 100644 (file)
@@ -18,9 +18,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <stdint.h>
 #include <string.h>
 
+#include "avstring.h"
 #include "common.h"
 #include "mem.h"
 #include "stereo3d.h"
@@ -67,8 +67,7 @@ int av_stereo3d_from_name(const char *name)
     int i;
 
     for (i = 0; i < FF_ARRAY_ELEMS(stereo3d_type_names); i++) {
-        size_t len = strlen(stereo3d_type_names[i]);
-        if (!strncmp(stereo3d_type_names[i], name, len))
+        if (av_strstart(name, stereo3d_type_names[i], NULL))
             return i;
     }