diff --git a/daemon/commands/audio-stream-stop.cc b/daemon/commands/audio-stream-stop.cc index 5326932d6..99c2653e5 100644 --- a/daemon/commands/audio-stream-stop.cc +++ b/daemon/commands/audio-stream-stop.cc @@ -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).")); diff --git a/daemon/daemon.cc b/daemon/daemon.cc index 34b9e1411..b9151d45d 100644 --- a/daemon/daemon.cc +++ b/daemon/daemon.cc @@ -319,6 +319,12 @@ AudioStream *Daemon::findAudioStream(int id) { return NULL; } +void Daemon::removeAudioStream(int id) { + std::map::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()); diff --git a/daemon/daemon.h b/daemon/daemon.h index 02913ee13..bc6b60845 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -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);