diff --git a/Core/HLE/sceMp3.cpp b/Core/HLE/sceMp3.cpp index ef5ecbffd9..f93f6c0e9c 100644 --- a/Core/HLE/sceMp3.cpp +++ b/Core/HLE/sceMp3.cpp @@ -496,9 +496,6 @@ static int sceMp3Init(u32 mp3) { ctx->Version = versionBits; - // This tells us to resample to the same frequency it decodes to. - ctx->decoder->SetResampleFrequency(ctx->freq); - return hleDelayResult(hleLogSuccessI(ME, 0), "mp3 init", PARSE_DELAY_MS); } diff --git a/Core/HW/SimpleAudioDec.cpp b/Core/HW/SimpleAudioDec.cpp index 80397bf6da..74e92b98dc 100644 --- a/Core/HW/SimpleAudioDec.cpp +++ b/Core/HW/SimpleAudioDec.cpp @@ -58,7 +58,7 @@ int SimpleAudio::GetAudioCodecID(int audioType) { SimpleAudio::SimpleAudio(int audioType, int sample_rate, int channels) : ctxPtr(0xFFFFFFFF), audioType(audioType), sample_rate_(sample_rate), channels_(channels), - outSamples(0), srcPos(0), wanted_resample_freq(44100), frame_(0), codec_(0), codecCtx_(0), swrCtx_(0), + outSamples(0), srcPos(0), frame_(0), codec_(0), codecCtx_(0), swrCtx_(0), codecOpen_(false) { Init(); } @@ -238,7 +238,7 @@ bool SimpleAudio::Decode(const uint8_t *inbuf, int inbytes, uint8_t *outbuf, int swrCtx_, wanted_channel_layout, AV_SAMPLE_FMT_S16, - wanted_resample_freq, + codecCtx_->sample_rate, dec_channel_layout, codecCtx_->sample_fmt, codecCtx_->sample_rate, diff --git a/Core/HW/SimpleAudioDec.h b/Core/HW/SimpleAudioDec.h index d70ee262d6..9f9e93ecfb 100644 --- a/Core/HW/SimpleAudioDec.h +++ b/Core/HW/SimpleAudioDec.h @@ -67,7 +67,6 @@ public: // These two are only here because of save states. int GetAudioType() const { return audioType; } - void SetResampleFrequency(int freq) { wanted_resample_freq = freq; } // Just metadata. void SetCtxPtr(u32 ptr) { ctxPtr = ptr; } @@ -83,7 +82,6 @@ private: int channels_; int outSamples; // output samples per frame int srcPos; // bytes consumed in source during the last decoding - int wanted_resample_freq; // wanted resampling rate/frequency AVFrame *frame_; #if HAVE_LIBAVCODEC_CONST_AVCODEC // USE_FFMPEG is implied @@ -139,7 +137,8 @@ public: u32 AuBufSize = 0; u32 PCMBuf = 0; u32 PCMBufSize = 0; - int freq = -1; + + int freq = -1; // used by AAC only? int BitRate = 0; int SamplingRate = -1; int Channels = 0;