mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 17:59:21 +00:00
Remove audio stream from the map when using the audio-stream-stop commands to prevent crash with wrong id parameter.
This commit is contained in:
parent
207f4a1211
commit
99cf5ab3d5
3 changed files with 8 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ void AudioStreamStopCommand::exec(Daemon *app, const char *args) {
|
|||
return;
|
||||
}
|
||||
audio_stream_stop(stream);
|
||||
app->removeAudioStream(id);
|
||||
app->sendResponse(Response());
|
||||
} else {
|
||||
app->sendResponse(Response("Missing/Incorrect parameter(s)."));
|
||||
|
|
|
|||
|
|
@ -319,6 +319,12 @@ AudioStream *Daemon::findAudioStream(int id) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void Daemon::removeAudioStream(int id) {
|
||||
std::map<int, AudioStream*>::iterator it = mAudioStreams.find(id);
|
||||
if (it != mAudioStreams.end())
|
||||
mAudioStreams.erase(it);
|
||||
}
|
||||
|
||||
void Daemon::initCommands() {
|
||||
mCommands.push_back(new RegisterCommand());
|
||||
mCommands.push_back(new RegisterStatusCommand());
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ public:
|
|||
LinphoneCall *findCall(int id);
|
||||
LinphoneProxyConfig *findProxy(int id);
|
||||
AudioStream *findAudioStream(int id);
|
||||
void removeAudioStream(int id);
|
||||
bool pullEvent();
|
||||
int updateCallId(LinphoneCall *call);
|
||||
int updateProxyId(LinphoneProxyConfig *proxy);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue