]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/spherical.c
avcodec: Remove redundant freeing of extradata of encoders
[ffmpeg] / libavutil / spherical.c
index 4be55f36cff994548977fd4c212ddb7039d95547..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"
 
@@ -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;
     }