summaryrefslogtreecommitdiff
path: root/libavutil/opt.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2013-12-16 16:11:49 +0100
committerStefano Sabatini <stefasab@gmail.com>2013-12-26 11:35:27 +0100
commit3b8c7da7a36d30f8184976ea2158b534595e7738 (patch)
tree5a8cada9925480d5568c1feff33513e58319a7bf /libavutil/opt.c
parent55f046be1193142536198957d1701d18881d3b7a (diff)
lavu,lavfi,lavd: do not hardcode AV_PIX_FMT_NB value when setting pixel format max value
The constant may change in libavutil but the library may be compiled against an older version, thus rejecting a value which is otherwise supported by the new libavutil. INT_MAX is used here to denote the max allowed value for a pixel format. The opt-test code is changed to provide a valid reference example.
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r--libavutil/opt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 0eaa8b5afe..5060b29391 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1600,7 +1600,7 @@ static const AVOption test_options[]= {
{"lame", "set lame flag ", 0, AV_OPT_TYPE_CONST, {.i64 = TEST_FLAG_LAME}, INT_MIN, INT_MAX, 0, "flags" },
{"mu", "set mu flag ", 0, AV_OPT_TYPE_CONST, {.i64 = TEST_FLAG_MU}, INT_MIN, INT_MAX, 0, "flags" },
{"size", "set size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE,{0}, 0, 0 },
-{"pix_fmt", "set pixfmt", OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, -1, AV_PIX_FMT_NB-1},
+{"pix_fmt", "set pixfmt", OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, -1, INT_MAX},
{"sample_fmt", "set samplefmt", OFFSET(sample_fmt), AV_OPT_TYPE_SAMPLE_FMT, {.i64 = AV_SAMPLE_FMT_NONE}, -1, AV_SAMPLE_FMT_NB-1},
{"video_rate", "set videorate", OFFSET(video_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0 },
{"duration", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX},