Merge commit '1bd986ed4b0e95ded368a8eeb5c044853c090f9b'
authorJames Almer <jamrial@gmail.com>
Tue, 24 Oct 2017 22:14:22 +0000 (19:14 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 24 Oct 2017 22:14:22 +0000 (19:14 -0300)
* commit '1bd986ed4b0e95ded368a8eeb5c044853c090f9b':
  hwcontext: Move NONE to the be the first member of AVHWDeviceType

Merged-by: James Almer <jamrial@gmail.com>
libavutil/hwcontext.c
libavutil/hwcontext.h

index 048e821..7f8e227 100644 (file)
@@ -79,7 +79,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;
index 03334e2..d208104 100644 (file)
 #include "pixfmt.h"
 
 enum AVHWDeviceType {
+    AV_HWDEVICE_TYPE_NONE,
     AV_HWDEVICE_TYPE_VDPAU,
     AV_HWDEVICE_TYPE_CUDA,
     AV_HWDEVICE_TYPE_VAAPI,
     AV_HWDEVICE_TYPE_DXVA2,
     AV_HWDEVICE_TYPE_QSV,
     AV_HWDEVICE_TYPE_VIDEOTOOLBOX,
-    AV_HWDEVICE_TYPE_NONE,
     AV_HWDEVICE_TYPE_D3D11VA,
     AV_HWDEVICE_TYPE_DRM,
 };