From cccc5849617e4ecbe6724b36398b5e26f063b146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 3 Sep 2021 11:50:40 +0200 Subject: [PATCH] api: Use fakesink when PipeWire enabled but unavailable Instead of misleading users that they are using PipeWire after enabling it, use fakesink in order to not output any sound at all --- lib/gst/clapper/gstclapper.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/gst/clapper/gstclapper.c b/lib/gst/clapper/gstclapper.c index 844c5229..6efd2491 100644 --- a/lib/gst/clapper/gstclapper.c +++ b/lib/gst/clapper/gstclapper.c @@ -3158,8 +3158,14 @@ gst_clapper_main (gpointer data) if (pipewiresink) { g_object_set (self->playbin, "audio-sink", pipewiresink, NULL); } else { - g_warning ("GstClapper: pipewiresink element not available. " - "Default audio sink will be used instead."); + GstElement *fakesink; + + g_warning ("GstClapper: pipewiresink element not available"); + fakesink = gst_element_factory_make ("fakesink", "fakeaudiosink"); + if (fakesink) + g_object_set (self->playbin, "audio-sink", fakesink, NULL); + else + g_warning ("GstClapper: default audio sink will be used instead"); } }