aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-28 23:55:34 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-01 00:31:38 +0100
commit52d928daf9c0dc715329f53c10ed9d3f486fceb6 (patch)
tree8a8e9ab484b063e4dc0a6dfb7ab90d6c246167ab
parentd46c3b8171b30e757f1f80f88e5b8ceda9a48831 (diff)
downloadffmpeg-52d928daf9c0dc715329f53c10ed9d3f486fceb6.tar.gz
avutil/opt: allow max=min=0 for pixel formats
This is neccessary for maintaining ABI compatibility with FFmpeg 2.1 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/opt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index bff3b6e555..652a2ddbb3 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -327,6 +327,12 @@ static int set_string_fmt(void *obj, const AVOption *o, const char *val, uint8_t
min = FFMAX(o->min, -1);
max = FFMIN(o->max, fmt_nb-1);
+ // hack for compatibility with old ffmpeg
+ if(min == 0 && max == 0) {
+ min = -1;
+ max = fmt_nb-1;
+ }
+
if (fmt < min || fmt > max) {
av_log(obj, AV_LOG_ERROR,
"Value %d for parameter '%s' out of %s format range [%d - %d]\n",