We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AudioPacket* AccompanyDecoder::decodePacket(){ // LOGI("MadDecoder::decodePacket packetBufferSize is %d", packetBufferSize); short* samples = new short[packetBufferSize]; // LOGI("accompanyPacket buffer's addr is %x", samples); int stereoSampleSize = readSamples(samples, packetBufferSize); AudioPacket* samplePacket = new AudioPacket(); if (stereoSampleSize > 0) { //构造成一个packet samplePacket->buffer = samples; samplePacket->size = stereoSampleSize; /** 这里由于每一个packet的大小不一样有可能是200ms 但是这样子position就有可能不准确了 **/ samplePacket->position = position; } else { samplePacket->size = -1; } return samplePacket; } 中的 AudioPacket* samplePacket = new AudioPacket();new了一个AudioPacket结构体,没有delete,导致内存泄漏
AudioPacket* AccompanyDecoder::decodePacket(){ // LOGI("MadDecoder::decodePacket packetBufferSize is %d", packetBufferSize); short* samples = new short[packetBufferSize]; // LOGI("accompanyPacket buffer's addr is %x", samples); int stereoSampleSize = readSamples(samples, packetBufferSize); AudioPacket* samplePacket = new AudioPacket(); if (stereoSampleSize > 0) { //构造成一个packet samplePacket->buffer = samples; samplePacket->size = stereoSampleSize; /** 这里由于每一个packet的大小不一样有可能是200ms 但是这样子position就有可能不准确了 **/ samplePacket->position = position; } else { samplePacket->size = -1; } return samplePacket; }
AudioPacket* samplePacket = new AudioPacket();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
accompany_decoder.cpp第147行:
AudioPacket* AccompanyDecoder::decodePacket(){ // LOGI("MadDecoder::decodePacket packetBufferSize is %d", packetBufferSize); short* samples = new short[packetBufferSize]; // LOGI("accompanyPacket buffer's addr is %x", samples); int stereoSampleSize = readSamples(samples, packetBufferSize); AudioPacket* samplePacket = new AudioPacket(); if (stereoSampleSize > 0) { //构造成一个packet samplePacket->buffer = samples; samplePacket->size = stereoSampleSize; /** 这里由于每一个packet的大小不一样有可能是200ms 但是这样子position就有可能不准确了 **/ samplePacket->position = position; } else { samplePacket->size = -1; } return samplePacket; }
中的
AudioPacket* samplePacket = new AudioPacket();
new了一个AudioPacket结构体,没有delete,导致内存泄漏The text was updated successfully, but these errors were encountered: