X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fopusdec.c;h=03086dea99e2c3ac6a8865e1ca873082c74e2088;hb=c490fc9536dcea7fdf1245a340bf075533610bc2;hp=5a7ba9dbb43546ebcf13804b92fc9d83d501ae81;hpb=4391d6cb8180f1261e38a588b7c4ffc457531cb2;p=ffmpeg diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index 5a7ba9dbb43..03086dea99e 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -687,7 +687,7 @@ static av_cold int opus_decode_init(AVCodecContext *avctx) if (ret < 0) goto fail; - ret = ff_celt_init(avctx, &s->celt, s->output_channels); + ret = ff_celt_init(avctx, &s->celt, s->output_channels, c->apply_phase_inv); if (ret < 0) goto fail; @@ -712,9 +712,24 @@ fail: return ret; } +#define OFFSET(x) offsetof(OpusContext, x) +#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM +static const AVOption opus_options[] = { + { "apply_phase_inv", "Apply intensity stereo phase inversion", OFFSET(apply_phase_inv), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, AD }, + { NULL }, +}; + +static const AVClass opus_class = { + .class_name = "Opus Decoder", + .item_name = av_default_item_name, + .option = opus_options, + .version = LIBAVUTIL_VERSION_INT, +}; + AVCodec ff_opus_decoder = { .name = "opus", .long_name = NULL_IF_CONFIG_SMALL("Opus"), + .priv_class = &opus_class, .type = AVMEDIA_TYPE_AUDIO, .id = AV_CODEC_ID_OPUS, .priv_data_size = sizeof(OpusContext),