[FFmpeg-devel] fix for colorspace minimum option value
jon
jon at tweaksoftware.com
Mon Nov 10 19:49:42 CET 2014
From 616d5017d8d2e566db3deb2696cc1672f2019777 Mon Sep 17 00:00:00 2001
From: Jon Morley <jon at tweaksoftware.com>
Date: Mon, 10 Nov 2014 10:43:42 -0800
Subject: [PATCH] options_table.h: min value for colorspace is 0
(AVCOL_SPC_RGB)
The min value for colorspace should be zero and not one since the first
valid index into the frame colorspace array is AVCOL_SPC_RGB which is 0.
---
libavcodec/options_table.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index d617ae7..b72fbb1 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -432,7 +432,7 @@ static const AVOption avcodec_options[] = {
{"iec61966_2_1", "IEC 61966-2-1", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
{"bt2020_10bit", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCOL_TRC_BT2020_10 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
{"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCOL_TRC_BT2020_12 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT,
{.i64 = AVCOL_SPC_UNSPECIFIED }, 1, AVCOL_SPC_NB-1, V|E|D,
"colorspace_type"},
+{"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT,
{.i64 = AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D,
"colorspace_type"},
{"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCOL_SPC_RGB }, INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
{"bt709", "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCOL_SPC_BT709 }, INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCOL_SPC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
--
1.8.5.2 (Apple Git-48)
-------------- next part --------------
>From 616d5017d8d2e566db3deb2696cc1672f2019777 Mon Sep 17 00:00:00 2001
From: Jon Morley <jon at tweaksoftware.com>
Date: Mon, 10 Nov 2014 10:43:42 -0800
Subject: [PATCH] options_table.h: min value for colorspace is 0
(AVCOL_SPC_RGB)
The min value for colorspace should be zero and not one since the first
valid index into the frame colorspace array is AVCOL_SPC_RGB which is 0.
---
libavcodec/options_table.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index d617ae7..b72fbb1 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -432,7 +432,7 @@ static const AVOption avcodec_options[] = {
{"iec61966_2_1", "IEC 61966-2-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
{"bt2020_10bit", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_10 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
{"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_12 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = AVCOL_SPC_UNSPECIFIED }, 1, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
+{"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
{"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB }, INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
{"bt709", "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT709 }, INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
--
1.8.5.2 (Apple Git-48)
More information about the ffmpeg-devel
mailing list