GstEnginePipeline: Use gst_bus_remove_watch to remove bus watch
This commit is contained in:
@@ -114,7 +114,6 @@ GstEnginePipeline::GstEnginePipeline(GstEngine *engine, QObject *parent)
|
|||||||
pad_added_cb_id_(-1),
|
pad_added_cb_id_(-1),
|
||||||
notify_source_cb_id_(-1),
|
notify_source_cb_id_(-1),
|
||||||
about_to_finish_cb_id_(-1),
|
about_to_finish_cb_id_(-1),
|
||||||
bus_cb_id_(-1),
|
|
||||||
unsupported_analyzer_(false) {
|
unsupported_analyzer_(false) {
|
||||||
|
|
||||||
if (!sElementDeleter) {
|
if (!sElementDeleter) {
|
||||||
@@ -142,12 +141,9 @@ GstEnginePipeline::~GstEnginePipeline() {
|
|||||||
g_signal_handler_disconnect(G_OBJECT(pipeline_), about_to_finish_cb_id_);
|
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_));
|
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline_));
|
||||||
if (bus) {
|
if (bus) {
|
||||||
|
gst_bus_remove_watch(bus);
|
||||||
gst_bus_set_sync_handler(bus, nullptr, nullptr, nullptr);
|
gst_bus_set_sync_handler(bus, nullptr, nullptr, nullptr);
|
||||||
gst_object_unref(bus);
|
gst_object_unref(bus);
|
||||||
}
|
}
|
||||||
@@ -468,7 +464,7 @@ bool GstEnginePipeline::InitAudioBin() {
|
|||||||
|
|
||||||
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline_));
|
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline_));
|
||||||
gst_bus_set_sync_handler(bus, BusCallbackSync, this, nullptr);
|
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);
|
gst_object_unref(bus);
|
||||||
|
|
||||||
unsupported_analyzer_ = false;
|
unsupported_analyzer_ = false;
|
||||||
|
|||||||
@@ -289,7 +289,6 @@ class GstEnginePipeline : public QObject {
|
|||||||
int pad_added_cb_id_;
|
int pad_added_cb_id_;
|
||||||
int notify_source_cb_id_;
|
int notify_source_cb_id_;
|
||||||
int about_to_finish_cb_id_;
|
int about_to_finish_cb_id_;
|
||||||
int bus_cb_id_;
|
|
||||||
|
|
||||||
QThreadPool set_state_threadpool_;
|
QThreadPool set_state_threadpool_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user