1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-28 16:20:26 +01:00

GstEnginePipeline: Use gst_bus_remove_watch to remove bus watch

This commit is contained in:
Jonas Kvinge 2021-10-08 23:39:29 +02:00
parent 6b2e25122d
commit d0f1522f0d
2 changed files with 2 additions and 7 deletions

View File

@ -114,7 +114,6 @@ GstEnginePipeline::GstEnginePipeline(GstEngine *engine, QObject *parent)
pad_added_cb_id_(-1),
notify_source_cb_id_(-1),
about_to_finish_cb_id_(-1),
bus_cb_id_(-1),
unsupported_analyzer_(false) {
if (!sElementDeleter) {
@ -142,12 +141,9 @@ GstEnginePipeline::~GstEnginePipeline() {
g_signal_handler_disconnect(G_OBJECT(pipeline_), about_to_finish_cb_id_);
}
if (bus_cb_id_ != -1) {
g_source_remove(bus_cb_id_);
}
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline_));
if (bus) {
gst_bus_remove_watch(bus);
gst_bus_set_sync_handler(bus, nullptr, nullptr, nullptr);
gst_object_unref(bus);
}
@ -468,7 +464,7 @@ bool GstEnginePipeline::InitAudioBin() {
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);
unsupported_analyzer_ = false;

View File

@ -289,7 +289,6 @@ class GstEnginePipeline : public QObject {
int pad_added_cb_id_;
int notify_source_cb_id_;
int about_to_finish_cb_id_;
int bus_cb_id_;
QThreadPool set_state_threadpool_;