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

* #29866: fixed deallocation of recorder

parent 9308e26d
......@@ -147,8 +147,8 @@ OpenSLLayer::OpenSLLayer()
, recorderBufferQueue_(0)
, playbackBufferIndex_(0)
, recordBufferIndex_(0)
, playbackBufferStack_(ANDROID_BUFFER_QUEUE_LENGTH, AudioBuffer(3000))
, recordBufferStack_(ANDROID_BUFFER_QUEUE_LENGTH, AudioBuffer(3000))
, playbackBufferStack_(ANDROID_BUFFER_QUEUE_LENGTH, AudioBuffer(BUFFER_SIZE))
, recordBufferStack_(ANDROID_BUFFER_QUEUE_LENGTH, AudioBuffer(BUFFER_SIZE))
{
}
......@@ -257,9 +257,15 @@ OpenSLLayer::shutdownAudioEngine()
outputMixer_ = NULL;
}
if(recorderObject_ != NULL){
(*recorderObject_)->Destroy(recorderObject_);
recorderObject_ = NULL;
recorderInterface_ = NULL;
recorderBufferQueue_ = NULL;
}
// destroy engine object, and invalidate all associated interfaces
DEBUG("Shutdown audio engine\n");
if (engineObject_ != NULL) {
(*engineObject_)->Destroy(engineObject_);
engineObject_ = NULL;
......
......@@ -36,6 +36,7 @@
#include <vector>
#include "../audiolayer.h"
#include "logger.h"
enum PCMType {
......@@ -52,6 +53,7 @@ class AudioPreference;
class OpenSLThread;
#define ANDROID_BUFFER_QUEUE_LENGTH 2
#define BUFFER_SIZE 5000
/**
......@@ -238,9 +240,7 @@ class OpenSLLayer : public AudioLayer {
* Output mix interface
*/
SLObjectItf outputMixer_;
SLObjectItf playerObject_;
SLObjectItf recorderObject_;
/**
......
Markdown is supported
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