It makes the intent clearer and avoids calculating the length
separately.
Signed-off-by: Andreas Rheinhardt <[email protected]>
---
libavutil/spherical.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavutil/spherical.c b/libavutil/spherical.c
index 4a7f3e49ca..ed66344a2f 100644
--- a/libavutil/spherical.c
+++ b/libavutil/spherical.c
@@ -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;
}
--
2.27.0
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".