Bug 1874684 - Part 28: Return DateDuration from DifferenceISODateTime. r=mgaudet
[gecko.git] / media / ffvpx / opusenc-dtx.patch
blobbf9fc9de87fececf9114bcb5e8bf1141b03dc7b5
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 {
5 int application;
6 int packet_loss;
7 int fec;
8 int complexity;
9 float frame_duration;
10 int packet_size;
11 int max_bandwidth;
12 int mapping_family;
13 + int dtx;
14 #ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST
15 int apply_phase_inv;
16 #endif
17 } LibopusEncOpts;
19 typedef struct LibopusEncContext {
20 AVClass *class;
21 OpusMSEncoder *enc;
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));
26 if (ret != OPUS_OK)
27 av_log(avctx, AV_LOG_WARNING,
28 "Unable to set inband FEC: %s\n",
29 opus_strerror(ret));
31 + ret = opus_multistream_encoder_ctl(enc,
32 + OPUS_SET_DTX(opts->dtx));
33 + if (ret != OPUS_OK)
34 + av_log(avctx, AV_LOG_WARNING,
35 + "Unable to set DTX: %s\n",
36 + opus_strerror(ret));
38 if (avctx->cutoff) {
39 ret = opus_multistream_encoder_ctl(enc,
40 OPUS_SET_MAX_BANDWIDTH(opts->max_bandwidth));
41 if (ret != OPUS_OK)
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 },
58 #endif
59 { NULL },
62 static const AVClass libopus_class = {
63 .class_name = "libopus",