summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-10-06 22:48:13 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2015-10-07 08:55:18 -0400
commitb3b6665c605328174ef014ae42719d7ab462d0a2 (patch)
treec6f536df481cadebc970f1d43968174b30622f13 /libavcodec/libx264.c
parent2d8ef1b6902dcf9e8afe9a4d6c5c459c6b5b705c (diff)
avcodec/libx264: silence -Waddress
This patch moves the pointer validity check outside the macro, and silences the -Waddress observed with GCC 5.2. Note that this changes the error message slightly, from: "bad option..." to "Error parsing option...". Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 75b5a5feba..cc79250d0f 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -399,7 +399,7 @@ static av_cold int X264_close(AVCodecContext *avctx)
#define OPT_STR(opt, param) \
do { \
int ret; \
- if (param && (ret = x264_param_parse(&x4->params, opt, param)) < 0) { \
+ if ((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); \
@@ -490,7 +490,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.i_log_level = X264_LOG_DEBUG;
x4->params.i_csp = convert_pix_fmt(avctx->pix_fmt);
- OPT_STR("weightp", x4->wpredp);
+ PARSE_X264_OPT("weightp", wpredp);
if (avctx->bit_rate) {
x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
@@ -520,7 +520,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
(float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
}
- OPT_STR("level", x4->level);
+ PARSE_X264_OPT("level", level);
if (avctx->i_quant_factor > 0)
x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor);