summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-03-23 19:49:39 +0000
committerMark Thompson <sw@jkqxz.net>2017-03-27 21:54:06 +0100
commit1bd986ed4b0e95ded368a8eeb5c044853c090f9b (patch)
tree0f07649bf3b176ce72f386f1446c678af3564ec7 /libavutil/hwcontext.c
parent0b9a237b2386ff84a6f99716bd58fa27a1b767e7 (diff)
downloadffmpeg-1bd986ed4b0e95ded368a8eeb5c044853c090f9b.tar.gz
hwcontext: Move NONE to the be the first member of AVHWDeviceType
Also use that to fix a warning in av_hwdevice_get_type_name().
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r--libavutil/hwcontext.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 2c6d51ee55..ff9fe99aba 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -67,7 +67,8 @@ enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name)
const char *av_hwdevice_get_type_name(enum AVHWDeviceType type)
{
- if (type >= 0 && type < FF_ARRAY_ELEMS(hw_type_names))
+ if (type > AV_HWDEVICE_TYPE_NONE &&
+ type < FF_ARRAY_ELEMS(hw_type_names))
return hw_type_names[type];
else
return NULL;