cmdutils: use macros for device test
authorLukasz Marek <lukasz.m.luki2@gmail.com>
Sat, 13 Dec 2014 18:54:39 +0000 (19:54 +0100)
committerLukasz Marek <lukasz.m.luki2@gmail.com>
Sun, 14 Dec 2014 22:55:41 +0000 (23:55 +0100)
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
cmdutils.c

index b68dae9..4e0a406 100644 (file)
@@ -1213,12 +1213,7 @@ static int is_device(const AVClass *avclass)
 {
     if (!avclass)
         return 0;
-    return avclass->category == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT ||
-           avclass->category == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT ||
-           avclass->category == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT ||
-           avclass->category == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT ||
-           avclass->category == AV_CLASS_CATEGORY_DEVICE_OUTPUT ||
-           avclass->category == AV_CLASS_CATEGORY_DEVICE_INPUT;
+    return AV_IS_INPUT_DEVICE(avclass->category) || AV_IS_OUTPUT_DEVICE(avclass->category);
 }
 
 static int show_formats_devices(void *optctx, const char *opt, const char *arg, int device_only)