Commit 0c721afd authored by Alexandre Lision's avatar Alexandre Lision
Browse files

* #29866: fixed deallocation of recorder

parent 9308e26d
...@@ -147,8 +147,8 @@ OpenSLLayer::OpenSLLayer() ...@@ -147,8 +147,8 @@ OpenSLLayer::OpenSLLayer()
, recorderBufferQueue_(0) , recorderBufferQueue_(0)
, playbackBufferIndex_(0) , playbackBufferIndex_(0)
, recordBufferIndex_(0) , recordBufferIndex_(0)
, playbackBufferStack_(ANDROID_BUFFER_QUEUE_LENGTH, AudioBuffer(3000)) , playbackBufferStack_(ANDROID_BUFFER_QUEUE_LENGTH, AudioBuffer(BUFFER_SIZE))
, recordBufferStack_(ANDROID_BUFFER_QUEUE_LENGTH, AudioBuffer(3000)) , recordBufferStack_(ANDROID_BUFFER_QUEUE_LENGTH, AudioBuffer(BUFFER_SIZE))
{ {
} }
...@@ -257,9 +257,15 @@ OpenSLLayer::shutdownAudioEngine() ...@@ -257,9 +257,15 @@ OpenSLLayer::shutdownAudioEngine()
outputMixer_ = NULL; outputMixer_ = NULL;
} }
if(recorderObject_ != NULL){
(*recorderObject_)->Destroy(recorderObject_);
recorderObject_ = NULL;
recorderInterface_ = NULL;
recorderBufferQueue_ = NULL;
}
// destroy engine object, and invalidate all associated interfaces // destroy engine object, and invalidate all associated interfaces
DEBUG("Shutdown audio engine\n"); DEBUG("Shutdown audio engine\n");
if (engineObject_ != NULL) { if (engineObject_ != NULL) {
(*engineObject_)->Destroy(engineObject_); (*engineObject_)->Destroy(engineObject_);
engineObject_ = NULL; engineObject_ = NULL;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <vector> #include <vector>
#include "../audiolayer.h" #include "../audiolayer.h"
#include "logger.h"
enum PCMType { enum PCMType {
...@@ -52,6 +53,7 @@ class AudioPreference; ...@@ -52,6 +53,7 @@ class AudioPreference;
class OpenSLThread; class OpenSLThread;
#define ANDROID_BUFFER_QUEUE_LENGTH 2 #define ANDROID_BUFFER_QUEUE_LENGTH 2
#define BUFFER_SIZE 5000
/** /**
...@@ -238,9 +240,7 @@ class OpenSLLayer : public AudioLayer { ...@@ -238,9 +240,7 @@ class OpenSLLayer : public AudioLayer {
* Output mix interface * Output mix interface
*/ */
SLObjectItf outputMixer_; SLObjectItf outputMixer_;
SLObjectItf playerObject_; SLObjectItf playerObject_;
SLObjectItf recorderObject_; SLObjectItf recorderObject_;
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment