From 334e2e23638349333f1a8b231599a28fb7fc3fab Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Mon, 16 Dec 2013 16:29:44 +0100 Subject: lavu,lavc,lswr: do not hardcode AV_SAMPLE_FMT_NB value when setting sample 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 sample format. The opt-test code is changed to provide a valid reference example. --- libavutil/opt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavutil/opt.c') diff --git a/libavutil/opt.c b/libavutil/opt.c index 5060b29391..07864f25c9 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1601,7 +1601,7 @@ static const AVOption test_options[]= { {"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, 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}, +{"sample_fmt", "set samplefmt", OFFSET(sample_fmt), AV_OPT_TYPE_SAMPLE_FMT, {.i64 = AV_SAMPLE_FMT_NONE}, -1, INT_MAX}, {"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}, {"color", "set color", OFFSET(color), AV_OPT_TYPE_COLOR, {.str = "pink"}, 0, 0}, -- cgit v1.2.3