diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-24 03:34:15 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-28 17:14:21 +0100 |
commit | 13e98f1dafd58b1703256ead6bc47858ce127a7f (patch) | |
tree | 433e5f5669c374aa8d7078fc856e1c38f1200de9 /libavutil | |
parent | 114603d0b9ce5440be5efce773361fb96c290b08 (diff) | |
download | ffmpeg-13e98f1dafd58b1703256ead6bc47858ce127a7f.tar.gz |
avutil/stereo3d: Use av_strstart instead of strncmp
It makes the intent clearer and avoids calculating the length
separately.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/stereo3d.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c index 6edcdb1796..279fcc1ff3 100644 --- a/libavutil/stereo3d.c +++ b/libavutil/stereo3d.c @@ -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; } |