From e44aa0e31c3446c06611f826dae834b293618873 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Tue, 6 Jun 2023 17:15:26 +0800 Subject: [PATCH] FIX: [STUDIO-2431] unset audio sink from gst playbin Change-Id: I4e3e1656842167b039d11003e75b7f4b6048b178 --- src/slic3r/GUI/wxMediaCtrl2.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/slic3r/GUI/wxMediaCtrl2.cpp b/src/slic3r/GUI/wxMediaCtrl2.cpp index ef35b5d30..274626e3b 100644 --- a/src/slic3r/GUI/wxMediaCtrl2.cpp +++ b/src/slic3r/GUI/wxMediaCtrl2.cpp @@ -9,6 +9,13 @@ #ifdef __LINUX__ #include "Printer/gstbambusrc.h" +#include // main gstreamer header +class WXDLLIMPEXP_MEDIA + wxGStreamerMediaBackend : public wxMediaBackendCommonBase +{ +public: + GstElement *m_playbin; // GStreamer media element +}; #endif wxMediaCtrl2::wxMediaCtrl2(wxWindow *parent) @@ -30,6 +37,10 @@ wxMediaCtrl2::wxMediaCtrl2(wxWindow *parent) wxMediaCtrl::Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxMEDIACTRLPLAYERCONTROLS_NONE); #ifdef __LINUX__ /* Register only after we have created the wxMediaCtrl, since only then are we guaranteed to have fired up Gstreamer's plugin registry. */ + auto playbin = reinterpret_cast(m_imp)->m_playbin; + g_object_set (G_OBJECT (playbin), + "audio-sink", NULL, + NULL); gstbambusrc_register(); Bind(wxEVT_MEDIA_LOADED, [this](auto & e) { m_loaded = true;