summaryrefslogtreecommitdiff
path: root/libavcodec/wavpackenc.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-09-09 09:49:24 +0000
committerPaul B Mahol <onemda@gmail.com>2015-09-09 10:01:10 +0000
commit8bf2d3e468821e542660b528fb8f89f616ee6e0b (patch)
treeb3d9d48fcb3a6ece27949223011cf2bc6a400ae1 /libavcodec/wavpackenc.c
parent6603368ab41d958647d3a71d44fb8417c6fafac4 (diff)
avcodec/wavpackenc: use AV_OPT_TYPE_BOOL for all options
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/wavpackenc.c')
-rw-r--r--libavcodec/wavpackenc.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index 6091e3f39b..977bcf0e04 100644
--- a/libavcodec/wavpackenc.c
+++ b/libavcodec/wavpackenc.c
@@ -1829,9 +1829,9 @@ static int wv_stereo(WavPackEncodeContext *s,
log_limit = (((s->flags & MAG_MASK) >> MAG_LSB) + 4) * 256;
log_limit = FFMIN(6912, log_limit);
- if (s->joint) {
- force_js = s->joint > 0;
- force_ts = s->joint < 0;
+ if (s->joint != -1) {
+ force_js = s->joint;
+ force_ts = !s->joint;
}
if ((ret = allocate_buffers(s)) < 0)
@@ -2955,13 +2955,8 @@ static av_cold int wavpack_encode_close(AVCodecContext *avctx)
#define OFFSET(x) offsetof(WavPackEncodeContext, x)
#define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
static const AVOption options[] = {
- { "joint_stereo", "", OFFSET(joint), AV_OPT_TYPE_INT, {.i64=0},-1, 1, FLAGS, "joint" },
- { "on", "mid/side", 0, AV_OPT_TYPE_CONST, {.i64= 1}, 0, 0, FLAGS, "joint"},
- { "off", "left/right", 0, AV_OPT_TYPE_CONST, {.i64=-1}, 0, 0, FLAGS, "joint"},
- { "auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64= 0}, 0, 0, FLAGS, "joint"},
- { "optimize_mono", "", OFFSET(optimize_mono), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "opt_mono" },
- { "on", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "opt_mono"},
- { "off", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "opt_mono"},
+ { "joint_stereo", "", OFFSET(joint), AV_OPT_TYPE_BOOL, {.i64=-1}, -1, 1, FLAGS },
+ { "optimize_mono", "", OFFSET(optimize_mono), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL },
};