Skip to content
Snippets Groups Projects
Unverified Commit 66d63072 authored by Nicolas Werner's avatar Nicolas Werner Committed by GitHub
Browse files

Merge pull request #283 from trilene/voip

Remove bus watch when call ends
parents 9b8e6969 2526a560
No related branches found
No related tags found
No related merge requests found
......@@ -495,7 +495,7 @@ WebRTCSession::startPipeline(int opusPayloadType)
}
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipe_));
gst_bus_add_watch(bus, newBusMessage, this);
busWatchId_ = gst_bus_add_watch(bus, newBusMessage, this);
gst_object_unref(bus);
emit stateChanged(State::INITIATED);
return true;
......@@ -601,6 +601,8 @@ WebRTCSession::end()
gst_element_set_state(pipe_, GST_STATE_NULL);
gst_object_unref(pipe_);
pipe_ = nullptr;
g_source_remove(busWatchId_);
busWatchId_ = 0;
}
webrtc_ = nullptr;
if (state_ != State::DISCONNECTED)
......
......@@ -64,10 +64,11 @@ private slots:
private:
WebRTCSession();
bool initialised_ = false;
State state_ = State::DISCONNECTED;
GstElement *pipe_ = nullptr;
GstElement *webrtc_ = nullptr;
bool initialised_ = false;
State state_ = State::DISCONNECTED;
GstElement *pipe_ = nullptr;
GstElement *webrtc_ = nullptr;
unsigned int busWatchId_ = 0;
std::string stunServer_;
std::vector<std::string> turnServers_;
GList *audioSources_ = nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment