[FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value
Vittorio Giovara
vittorio.giovara at gmail.com
Wed Sep 20 14:59:33 EEST 2017
+2017-09-20 13:32 GMT+02:00 Vittorio Giovara <vittorio.giovara at
gmail.com <http://ffmpeg.org/mailman/listinfo/ffmpeg-devel>>:
+
+>* +int av_color_range_from_name(const char *name)
*+>* +{
*+>* + int i;
*+>* +
*+>* + for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) {
*+>* + size_t len = strlen(color_range_names[i]);
*+>* + if (!strncmp(color_range_names[i], name, len))
*+>* + return i;
*+>* + }
*+>* +
*+>* + return -1;
*+
+Is there a reason why the functions do not return an error code?
+
+Carl Eugen
It's to be consistent with the other APIs that map a string to an enum,
like in spherical.c and stereo3d.c.
--
Vittorio
More information about the ffmpeg-devel
mailing list