1 diff --git a/media/ffvpx/libavcodec/libopusenc.c b/media/ffvpx/libavcodec/libopusenc.c
2 --- a/media/ffvpx/libavcodec/libopusenc.c
3 +++ b/media/ffvpx/libavcodec/libopusenc.c
4 @@ -37,16 +37,17 @@ typedef struct LibopusEncOpts {
14 #ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST
19 typedef struct LibopusEncContext {
22 @@ -154,16 +155,23 @@ static int libopus_configure_encoder(AVC
24 ret = opus_multistream_encoder_ctl(enc,
25 OPUS_SET_INBAND_FEC(opts->fec));
27 av_log(avctx, AV_LOG_WARNING,
28 "Unable to set inband FEC: %s\n",
31 + ret = opus_multistream_encoder_ctl(enc,
32 + OPUS_SET_DTX(opts->dtx));
34 + av_log(avctx, AV_LOG_WARNING,
35 + "Unable to set DTX: %s\n",
36 + opus_strerror(ret));
39 ret = opus_multistream_encoder_ctl(enc,
40 OPUS_SET_MAX_BANDWIDTH(opts->max_bandwidth));
42 av_log(avctx, AV_LOG_WARNING,
43 "Unable to set maximum bandwidth: %s\n", opus_strerror(ret));
46 @@ -551,16 +559,17 @@ static const AVOption libopus_options[]
47 { "frame_duration", "Duration of a frame in milliseconds", OFFSET(frame_duration), AV_OPT_TYPE_FLOAT, { .dbl = 20.0 }, 2.5, 120.0, FLAGS },
48 { "packet_loss", "Expected packet loss percentage", OFFSET(packet_loss), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, FLAGS },
49 { "fec", "Enable inband FEC. Expected packet loss must be non-zero", OFFSET(fec), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
50 { "vbr", "Variable bit rate mode", OFFSET(vbr), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 2, FLAGS, "vbr" },
51 { "off", "Use constant bit rate", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "vbr" },
52 { "on", "Use variable bit rate", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "vbr" },
53 { "constrained", "Use constrained VBR", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, FLAGS, "vbr" },
54 { "mapping_family", "Channel Mapping Family", OFFSET(mapping_family), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, FLAGS, "mapping_family" },
55 + { "dtx", "Enable DTX", OFFSET(dtx), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
56 #ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST
57 { "apply_phase_inv", "Apply intensity stereo phase inversion", OFFSET(apply_phase_inv), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
62 static const AVClass libopus_class = {
63 .class_name = "libopus",