Atrac: Fix lowlevel jointStereo usage.

Seems this value is supposed to be (channels << 3) form the lowlevel code,
which is believable.  FFmpeg skips it anyway.

Also, need to set the flag so it gets used.
This commit is contained in:
Unknown W. Brackets 2016-01-16 22:35:39 -08:00
parent 4e20b61d3a
commit 45e6f9e9b7

View File

@ -1703,7 +1703,7 @@ int __AtracSetContext(Atrac *atrac) {
// We don't pull this from the RIFF so that we can support OMA also.
// The only thing that changes are the jointStereo_ values.
atrac->codecCtx_->extradata[0] = 1;
atrac->codecCtx_->extradata[3] = 0x10;
atrac->codecCtx_->extradata[3] = atrac->channels_ << 3;
atrac->codecCtx_->extradata[6] = atrac->jointStereo_;
atrac->codecCtx_->extradata[8] = atrac->jointStereo_;
atrac->codecCtx_->extradata[10] = 1;
@ -2293,6 +2293,7 @@ static bool initAT3Decoder(Atrac *atrac, u8 *at3Header, u32 dataSize = 0xffb4a8)
at3Header[0x29] = atrac->channels_ << 3;
at3Header[0x2c] = at3HeaderMap[i].jointStereo;
at3Header[0x2e] = at3HeaderMap[i].jointStereo;
atrac->jointStereo_ = at3HeaderMap[i].jointStereo;
*(u32 *)(at3Header + sizeof(at3HeaderTemplate) - 4) = dataSize;
return true;
}