GstEnginePipeline: Get audio-sink

This commit is contained in:
Jonas Kvinge 2024-11-09 19:22:56 +01:00
parent 65b6e6d540
commit f59c6c356e
1 changed files with 6 additions and 1 deletions

View File

@ -182,9 +182,14 @@ GstEnginePipeline::~GstEnginePipeline() {
if (state() != GST_STATE_NULL) { if (state() != GST_STATE_NULL) {
gst_element_set_state(pipeline_, GST_STATE_NULL); gst_element_set_state(pipeline_, GST_STATE_NULL);
} }
GstElement *audiobin = nullptr;
g_object_get(GST_OBJECT(pipeline_), "audio-sink", &audiobin, nullptr);
gst_object_unref(GST_OBJECT(pipeline_)); gst_object_unref(GST_OBJECT(pipeline_));
pipeline_ = nullptr; pipeline_ = nullptr;
if (audiobin_ && !pipeline_connected_.value()) {
if (audiobin_ && audiobin_ != audiobin) {
gst_object_unref(GST_OBJECT(audiobin_)); gst_object_unref(GST_OBJECT(audiobin_));
} }
audiobin_ = nullptr; audiobin_ = nullptr;