diff options
author | Erik Slagter <erik@slagter.name> | 2011-07-18 20:04:15 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-07-20 02:20:08 +0200 |
commit | 045ef52ef513973a134f95c10a33f9ccb89ec92f (patch) | |
tree | b776991b7724da970198f6ef06d05f40cab6d798 | |
parent | d303e0affd9274381a098da55ef4eca954f23b74 (diff) | |
download | ffmpeg-045ef52ef513973a134f95c10a33f9ccb89ec92f.tar.gz |
libx264.c: distinguish between x264 parameter errors.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/libx264.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index cc5b9837f8..670a7802e1 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -198,14 +198,19 @@ static void check_default_settings(AVCodecContext *avctx) } } -#define OPT_STR(opt, param) \ - do { \ - if (param && x264_param_parse(&x4->params, opt, param) < 0) { \ - av_log(avctx, AV_LOG_ERROR, \ - "bad value for '%s': '%s'\n", opt, param); \ - return -1; \ - } \ - } while (0); \ +#define OPT_STR(opt, param) \ + do { \ + int ret; \ + if (param && (ret = x264_param_parse(&x4->params, opt, param)) < 0) { \ + if(ret == X264_PARAM_BAD_NAME) \ + av_log(avctx, AV_LOG_ERROR, \ + "bad option '%s': '%s'\n", opt, param); \ + else \ + av_log(avctx, AV_LOG_ERROR, \ + "bad value for '%s': '%s'\n", opt, param); \ + return -1; \ + } \ + } while (0); static av_cold int X264_init(AVCodecContext *avctx) { |