diff --git a/src/transcoder/transcoder.cpp b/src/transcoder/transcoder.cpp index 5352ad54f..973a161cc 100644 --- a/src/transcoder/transcoder.cpp +++ b/src/transcoder/transcoder.cpp @@ -358,21 +358,6 @@ void Transcoder::NewPadCallback(GstElement*, GstPad* pad, gst_object_unref(audiopad); } -gboolean Transcoder::BusCallback(GstBus*, GstMessage* msg, gpointer data) { - JobState* state = reinterpret_cast(data); - - switch (GST_MESSAGE_TYPE(msg)) { - case GST_MESSAGE_ERROR: - state->ReportError(msg); - state->PostFinished(false); - break; - - default: - break; - } - return GST_BUS_DROP; -} - GstBusSyncReply Transcoder::BusCallbackSync(GstBus*, GstMessage* msg, gpointer data) { JobState* state = reinterpret_cast(data); @@ -461,9 +446,6 @@ bool Transcoder::StartJob(const Job& job) { CHECKED_GCONNECT(decode, "pad-added", &NewPadCallback, state.get()); gst_bus_set_sync_handler(gst_pipeline_get_bus(GST_PIPELINE(state->pipeline_)), BusCallbackSync, state.get(), nullptr); - state->bus_callback_id_ = gst_bus_add_watch( - gst_pipeline_get_bus(GST_PIPELINE(state->pipeline_)), - BusCallback, state.get()); // Start the pipeline gst_element_set_state(state->pipeline_, GST_STATE_PLAYING); @@ -507,7 +489,6 @@ bool Transcoder::event(QEvent* e) { gst_bus_set_sync_handler( gst_pipeline_get_bus(GST_PIPELINE(finished_event->state_->pipeline_)), nullptr, nullptr, nullptr); - g_source_remove(finished_event->state_->bus_callback_id_); // Remove it from the list - this will also destroy the GStreamer pipeline current_jobs_.erase(it); @@ -537,7 +518,6 @@ void Transcoder::Cancel() { // called after the pipeline is shutting down gst_bus_set_sync_handler(gst_pipeline_get_bus( GST_PIPELINE(state->pipeline_)), nullptr, nullptr, nullptr); - g_source_remove(state->bus_callback_id_); // Stop the pipeline if (gst_element_set_state(state->pipeline_, GST_STATE_NULL) == diff --git a/src/transcoder/transcoder.h b/src/transcoder/transcoder.h index 8103c6ee9..b0787158d 100644 --- a/src/transcoder/transcoder.h +++ b/src/transcoder/transcoder.h @@ -90,8 +90,7 @@ signals: : job_(job), parent_(parent), pipeline_(nullptr), - convert_element_(nullptr), - bus_callback_id_(0) {} + convert_element_(nullptr) {} ~JobState(); void PostFinished(bool success); @@ -101,7 +100,6 @@ signals: Transcoder* parent_; GstElement* pipeline_; GstElement* convert_element_; - int bus_callback_id_; }; // Event passed from a GStreamer callback to the Transcoder when a job @@ -134,7 +132,6 @@ signals: void SetElementProperties(const QString& name, GObject* element); static void NewPadCallback(GstElement*, GstPad* pad, gpointer data); - static gboolean BusCallback(GstBus*, GstMessage* msg, gpointer data); static GstBusSyncReply BusCallbackSync(GstBus*, GstMessage* msg, gpointer data);