Skip to content

Conversation

@heistings
Copy link

@heistings heistings commented Jan 13, 2026

Summary

This PR adds support for controlling DRED (Deep REDundancy) duration through the ope_encoder_ctl() API, enabling applications using libopusenc to configure the new DRED feature introduced in Opus 1.5 for improved packet loss resilience.

Changes

Added two new case handlers in ope_encoder_ctl():

  • OPUS_SET_DRED_DURATION_REQUEST: Forward the DRED duration setting to the underlying multistream encoder
  • OPUS_GET_DRED_DURATION_REQUEST: Retrieve the current DRED duration from the encoder

Both cases are guarded by #ifdef to maintain backward compatibility with older libopus versions that don't support DRED.

Motivation

With Opus 1.5 introducing DRED (Deep REDundancy) for improved packet loss concealment, applications encoding to Ogg Opus files via libopusenc currently have no way to enable this feature. This patch bridges that gap by forwarding the DRED CTL requests through the libopusenc API.

Testing

Tested with Opus 1.5.2 built with --enable-dred. The DRED duration can now be successfully configured when encoding Ogg Opus streams.

‼️Note for Maintainers

Related PR: This fix depends on xiph/opus#450, which adds DRED CTL forwarding support to the multistream encoder API.

Both PRs are required for the complete DRED control path when encoding Ogg Opus files.

Add support for controlling DRED (Deep REDundancy) duration through the
ope_encoder_ctl() API. This allows applications using libopusenc to enable
and configure the new DRED feature introduced in Opus 1.5 for improved
packet loss resilience.

The new cases forward the OPUS_SET_DRED_DURATION_REQUEST and
OPUS_GET_DRED_DURATION_REQUEST control requests to the underlying
multistream encoder, enabling DRED functionality when encoding to
Ogg Opus files.

Signed-off-by: Hei Stansen <waterforest_pang@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant