X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavutil%2Fspherical.c;h=ed66344a2fd21d272ea898bba6a37172df38b660;hb=9e13df3776da3a101e895e2840f6f23f5a6f74a0;hp=4be55f36cff994548977fd4c212ddb7039d95547;hpb=52b44e9d15c0ee3c118ed68a0c2c737a9eb50ae9;p=ffmpeg diff --git a/libavutil/spherical.c b/libavutil/spherical.c index 4be55f36cff..ed66344a2fd 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" @@ -51,7 +52,7 @@ void av_spherical_tile_bounds(const AVSphericalMapping *map, *bottom = orig_height - height - *top; } -static const char *spherical_projection_names[] = { +static const char *const spherical_projection_names[] = { [AV_SPHERICAL_EQUIRECTANGULAR] = "equirectangular", [AV_SPHERICAL_CUBEMAP] = "cubemap", [AV_SPHERICAL_EQUIRECTANGULAR_TILE] = "tiled equirectangular", @@ -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; }