Merge pull request #4427 from unknownbrackets/volume-fix

Fix volume scaling for mono inputs, etc.
This commit is contained in:
Henrik Rydgård 2013-11-03 03:11:35 -08:00
commit 743fb154ae
2 changed files with 4 additions and 3 deletions

View File

@ -630,7 +630,7 @@ u32 _AtracDecodeData(int atracID, u8* outbuf, u32 *SamplesNum, u32* finish, int
if (avret < 0) {
ERROR_LOG(ME, "swr_convert: Error while converting %d", avret);
}
__AdjustBGMVolume((s16 *)out, numSamples * atrac->pFrame->channels);
__AdjustBGMVolume((s16 *)out, numSamples * atrac->atracOutputChannels);
}
}
av_free_packet(&packet);
@ -1780,7 +1780,7 @@ int sceAtracLowLevelDecode(int atracID, u32 sourceAddr, u32 sourceBytesConsumedA
if (avret < 0) {
ERROR_LOG(ME, "swr_convert: Error while converting %d", avret);
}
__AdjustBGMVolume((s16 *)out, numSamples * atrac->pFrame->channels);
__AdjustBGMVolume((s16 *)out, numSamples * atrac->atracOutputChannels);
}
av_free_packet(&packet);
if (got_frame)

View File

@ -142,7 +142,8 @@ bool SimpleAT3::Decode(void* inbuf, int inbytes, uint8_t *outbuf, int *outbytes)
ERROR_LOG(ME, "swr_convert: Error while converting %d", swrRet);
return false;
}
__AdjustBGMVolume((s16 *)outbuf, numSamples * frame_->channels);
// We always convert to stereo.
__AdjustBGMVolume((s16 *)outbuf, numSamples * 2);
}
return true;