Update minor comments

This commit is contained in:
kaienfr 2014-04-11 23:42:07 +02:00
parent 3a12cf2ad7
commit ee1d541c28
3 changed files with 8 additions and 12 deletions

View file

@ -344,7 +344,7 @@ int sceMp3GetSamplingRate(u32 mp3) {
}
int sceMp3GetInfoToAddStreamData(u32 mp3, u32 dstPtr, u32 towritePtr, u32 srcposPtr) {
INFO_LOG(ME, "sceMp3GetInfoToAddStreamData(%08X, %08X, %08X, %08X)", mp3, dstPtr, towritePtr, srcposPtr);
DEBUG_LOG(ME, "sceMp3GetInfoToAddStreamData(%08X, %08X, %08X, %08X)", mp3, dstPtr, towritePtr, srcposPtr);
AuCtx *ctx = getMp3Ctx(mp3);
if (!ctx) {
@ -356,7 +356,7 @@ int sceMp3GetInfoToAddStreamData(u32 mp3, u32 dstPtr, u32 towritePtr, u32 srcpos
}
int sceMp3NotifyAddStreamData(u32 mp3, int size) {
INFO_LOG(ME, "sceMp3NotifyAddStreamData(%08X, %i)", mp3, size);
DEBUG_LOG(ME, "sceMp3NotifyAddStreamData(%08X, %i)", mp3, size);
AuCtx *ctx = getMp3Ctx(mp3);
if (!ctx) {

View file

@ -69,7 +69,7 @@ SimpleAudio::SimpleAudio(int audioType)
frame_ = av_frame_alloc();
// Get Audio Codec ctx
// Get Audio Codec ID
if (!GetAudioCodecID(audioType)){
ERROR_LOG(ME, "This version of FFMPEG does not support Audio codec type: %08x. Update your submodule.", audioType);
return;
@ -78,7 +78,7 @@ SimpleAudio::SimpleAudio(int audioType)
codec_ = avcodec_find_decoder(audioCodecId);
if (!codec_) {
// Eh, we shouldn't even have managed to compile. But meh.
ERROR_LOG(ME, "This version of FFMPEG does not support AV_CODEC_ctx for audio (%s). Update your submodule.", GetCodecName(audioType));
ERROR_LOG(ME, "This version of FFMPEG does not support AV_CODEC_ID for audio (%s). Update your submodule.", GetCodecName(audioType));
return;
}
// Allocate codec context
@ -204,18 +204,14 @@ bool SimpleAudio::Decode(void* inbuf, int inbytes, uint8_t *outbuf, int *outbyte
av_frame_unref(frame_);
*outbytes = 0;
srcPos = 0;
int len = avcodec_decode_audio4(codecCtx_, frame_, &got_frame, &packet);
if (len < 0) {
srcPos = avcodec_decode_audio4(codecCtx_, frame_, &got_frame, &packet);
if (srcPos < 0) {
ERROR_LOG(ME, "Error decoding Audio frame");
// TODO: cleanup
return false;
}
av_free_packet(&packet);
// get bytes consumed in source
srcPos = len;
if (got_frame) {
// Initializing the sample rate convert. We will use it to convert float output into int.
int64_t wanted_channel_layout = AV_CH_LAYOUT_STEREO; // we want stereo output layout

View file

@ -60,7 +60,7 @@ public:
u32 ctxPtr;
int audioType;
int outSamples; // output samples per frame
int srcPos; // source position after decode
int srcPos; // bytes consumed in source during the last decoding
int wanted_resample_freq; // wanted resampling rate/frequency
private:
@ -155,7 +155,7 @@ public:
int sceAuGetVersion();
void DoState(PointerWrap &p) {
auto s = p.Section("AuContext", 1);
auto s = p.Section("AuContext", 0, 1);
if (!s)
return;