diff --git a/code/src/iamf_dec/IAMF_decoder.c b/code/src/iamf_dec/IAMF_decoder.c old mode 100644 new mode 100755 index 3e2e7ba9..0c688733 --- a/code/src/iamf_dec/IAMF_decoder.c +++ b/code/src/iamf_dec/IAMF_decoder.c @@ -673,8 +673,9 @@ static int iamf_codec_conf_get_sampling_rate(IAMF_CodecConf *c) { if (c->decoder_conf_size < 6) return IAMF_ERR_BAD_ARG; return reads32be(c->decoder_conf, 2); } else if (cid == IAMF_CODEC_OPUS) { - if (c->decoder_conf_size < 8) return IAMF_ERR_BAD_ARG; - return reads32be(c->decoder_conf, 4); + // https://aomediacodec.github.io/iamf/v1.1.0.html#opus-specific + // The sample rate used for computing offsets SHALL be 48 kHz. + return 48000; } else if (cid == IAMF_CODEC_AAC) { BitStream b; int ret, type; diff --git a/code/src/iamf_dec/opus/IAMF_opus_decoder.c b/code/src/iamf_dec/opus/IAMF_opus_decoder.c index 5b6e9a9b..b7e1221c 100755 --- a/code/src/iamf_dec/opus/IAMF_opus_decoder.c +++ b/code/src/iamf_dec/opus/IAMF_opus_decoder.c @@ -80,7 +80,7 @@ static int iamf_opus_init(IAMF_CodecContext *ths) { return IAMF_ERR_BAD_ARG; } - ths->sample_rate = readu32be(config, 4); + ths->sample_rate = 48000; // readu32be(config, 4); ths->channel_mapping_family = config[10]; ctx->dec = opus_multistream2_decoder_create(ths->sample_rate, ths->streams,