Gstreamer tests: use fakesink for audio output
This commit is contained in:
parent
d396b7d114
commit
f2547199a0
@ -61,6 +61,12 @@ class GStreamerPlaybackController(BasePlaybackController):
|
||||
|
||||
self.stop()
|
||||
|
||||
def use_fake_sink(self):
|
||||
"""For testing. To avoid audio output during testing, and the need for
|
||||
a sound card and a fully working gstreamer installation."""
|
||||
sink = gst.element_factory_make("fakesink", "fakesink")
|
||||
self._bin.set_property("audio-sink", sink)
|
||||
|
||||
def _set_state(self, state):
|
||||
self._bin.set_state(state)
|
||||
|
||||
|
||||
@ -28,6 +28,10 @@ class GStreamerPlaybackControllerTest(BasePlaybackControllerTest,
|
||||
for i in range(1, 4)]
|
||||
backend_class = GStreamerBackend
|
||||
|
||||
def setUp(self):
|
||||
super(GStreamerPlaybackControllerTest, self).setUp()
|
||||
self.backend.playback.use_fake_sink()
|
||||
|
||||
def add_track(self, path):
|
||||
uri = path_to_uri(data_folder(path))
|
||||
track = Track(uri=uri, id=1, length=4464)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user