Philipp Hörist pushed to branch master at gajim / gajim


Commits:
a265588d by mesonium at 2025-12-19T17:34:10+00:00
fix: VoiceMessageRecorderWidget: Don't fail on switching input device

After switching the input device from autoaudiosrc to something else,
recording would work only after the second attempt.

We want to ensure pipeline is in a state, where we can savely switch.
Furthermore we only ever want to switch, while no recording is in
progress, i.e. we must not set the source element into the playing
state at the end of the switch.

- - - - -


1 changed file:

- gajim/gtk/voice_message_recorder.py


Changes:

=====================================
gajim/gtk/voice_message_recorder.py
=====================================
@@ -351,12 +351,6 @@ def _handle_error_output_dir_inaccessible(self) -> None:
         self._error_callback(GST_ERROR_ON_MERGING, error_message)
         self.stop_and_reset()
 
-    def _custom_message(self, name: str) -> None:
-        custom_structure = Gst.Structure.new_empty(name)
-        custom_message = Gst.Message.new_application(None, custom_structure)
-        assert custom_message is not None
-        self._bus.post(custom_message)
-
     def _on_gst_message(self, _bus: Gst.Bus, message: Gst.Message) -> None:
         structure = message.get_structure()
         if structure is None:
@@ -386,10 +380,9 @@ def _on_gst_message(self, _bus: Gst.Bus, message: 
Gst.Message) -> None:
 
     def _switch_sources(self) -> None:
         assert self._queue is not None
+        assert not self.recording_in_progress
 
-        # Remove old src
         if self._audiosrc is not None:
-            self._audiosrc.set_state(Gst.State.NULL)
             self._audiosrc.unlink(self._queue)
             self._pipeline.remove(self._audiosrc)
 
@@ -397,7 +390,6 @@ def _switch_sources(self) -> None:
         if self._audiosrc is not None:
             self._pipeline.add(self._audiosrc)
             self._audiosrc.link(self._queue)
-            self._audiosrc.set_state(Gst.State.PLAYING)
 
         self._available = self._audiosrc is not None
         self.notify("available")



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/a265588d7f53208abdb4e7f3d68d14ff7a4a3c91

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/a265588d7f53208abdb4e7f3d68d14ff7a4a3c91
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to