mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
Audiofile doesn't free the audiocodec* anymore
Avoid segmentation fault when audiofile tries to unmap an audiolodec that is already unmapped
This commit is contained in:
@ -25,7 +25,6 @@
|
||||
#include <fstream>
|
||||
#include <math.h>
|
||||
#include <samplerate.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
AudioFile::AudioFile()
|
||||
: AudioLoop()
|
||||
@ -36,7 +35,6 @@ AudioFile::AudioFile()
|
||||
|
||||
AudioFile::~AudioFile()
|
||||
{
|
||||
delete _codec;
|
||||
}
|
||||
|
||||
// load file in mono format
|
||||
|
@ -909,20 +909,20 @@ ManagerImpl::ringtone()
|
||||
int sampleRate = audiolayer->getSampleRate();
|
||||
AudioCodec* codecForTone = _codecDescriptorMap.getFirstCodecAvailable();
|
||||
|
||||
//_toneMutex.enterMutex();
|
||||
// bool loadFile = _audiofile.loadFile(ringchoice, codecForTone , sampleRate);
|
||||
//_toneMutex.leaveMutex();
|
||||
//if (loadFile) {
|
||||
//_toneMutex.enterMutex();
|
||||
//_audiofile.start();
|
||||
//_toneMutex.leaveMutex();
|
||||
//int size = _audiofile.getSize();
|
||||
//SFLDataFormat output[ size ];
|
||||
//_audiofile.getNext(output, size , 100);
|
||||
//audiolayer->putUrgent( output , size );
|
||||
//} else {
|
||||
_toneMutex.enterMutex();
|
||||
bool loadFile = _audiofile.loadFile(ringchoice, codecForTone , sampleRate);
|
||||
_toneMutex.leaveMutex();
|
||||
if (loadFile) {
|
||||
_toneMutex.enterMutex();
|
||||
_audiofile.start();
|
||||
_toneMutex.leaveMutex();
|
||||
int size = _audiofile.getSize();
|
||||
SFLDataFormat output[ size ];
|
||||
_audiofile.getNext(output, size , 100);
|
||||
audiolayer->putUrgent( output , size );
|
||||
} else {
|
||||
ringback();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
AudioLoop*
|
||||
|
Reference in New Issue
Block a user