Change input type of the type->str function and return a proper error code for the str->type function. --- Similar reasoning to the previous patch. Vittorio
libavutil/stereo3d.c | 6 +++--- libavutil/stereo3d.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c index 5dc902e909..6e2f9f3ad2 100644 --- a/libavutil/stereo3d.c +++ b/libavutil/stereo3d.c @@ -54,9 +54,9 @@ static const char * const stereo3d_type_names[] = { [AV_STEREO3D_COLUMNS] = "interleaved columns", }; -const char *av_stereo3d_type_name(unsigned int type) +const char *av_stereo3d_type_name(enum AVStereo3DType type) { - if (type >= FF_ARRAY_ELEMS(stereo3d_type_names)) + if ((unsigned) type >= FF_ARRAY_ELEMS(stereo3d_type_names)) return "unknown"; return stereo3d_type_names[type]; @@ -72,5 +72,5 @@ int av_stereo3d_from_name(const char *name) return i; } - return -1; + return AVERROR(EINVAL); } diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h index 0fa9f63a2c..cbf138faef 100644 --- a/libavutil/stereo3d.h +++ b/libavutil/stereo3d.h @@ -190,7 +190,7 @@ AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame); * * @return The name of the stereo3d value, or "unknown". */ -const char *av_stereo3d_type_name(unsigned int type); +const char *av_stereo3d_type_name(enum AVStereo3DType type); /** * Get the AVStereo3DType form a human-readable name. -- 2.12.0 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel