Fix: Detaching bus callback in ~GstEnginePipeline

This commit is contained in:
Lukas Prediger 2021-10-07 23:22:34 +03:00 committed by John Maguire
parent 86b958015b
commit 5705d4fd85
2 changed files with 3 additions and 4 deletions

View File

@ -499,7 +499,7 @@ bool GstEnginePipeline::InitAudioBin() {
gst_object_unref(pad);
GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline_));
gst_bus_set_sync_handler(bus, BusCallbackSync, this, nullptr);
bus_cb_id_ = gst_bus_add_watch(bus, BusCallback, this);
gst_bus_add_watch(bus, BusCallback, this);
gst_object_unref(bus);
return true;
@ -567,10 +567,11 @@ bool GstEnginePipeline::InitFromReq(const MediaPlaybackRequest& req,
GstEnginePipeline::~GstEnginePipeline() {
if (pipeline_) {
GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline_));
gst_bus_remove_watch(bus);
gst_bus_set_sync_handler(bus, nullptr, nullptr, nullptr);
gst_object_unref(bus);
g_source_remove(bus_cb_id_);
gst_element_set_state(pipeline_, GST_STATE_NULL);
if (tee_) {

View File

@ -294,8 +294,6 @@ class GstEnginePipeline : public GstPipelineBase {
GstPad* tee_probe_pad_;
GstPad* tee_audio_pad_;
uint bus_cb_id_;
QThreadPool set_state_threadpool_;
GstSegment last_decodebin_segment_;