Well, i fix the problem with the tests in the category 'media'. In resume,
the 'dispatch_events' was removed from the Player class and that causes
that the test fail throwing a exception.
The solution was replace that call by
'pyglet.app.platform_event_loop.dispatch_posted_events()'. Obviously this
is not efficient but it is fine for the test (and emulate the previous code)
After this fix, the tests still failing. The problem was that the sources
used (from the media.procedural package) implements the method
'_get_audio_data' instead of 'get_audio_data'.
The final patch is attached.
With this, the tests pass except the media.PLAYER_PAUSE_QUEUE test. For
some reason, after playing the sound, a critical error is raised. Here is
the output
Assertion 's' failed at pulse/stream.c:2351, function pa_stream_trigger().
Aborting.
Abortado (`core' generado)
Someone can confirm this? I am using Pulse as a driver in a Ubuntu 12.04.
Bye!
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pyglet-users/-/Z9F5NS8E8AoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en.
diff -r 7fe0b5ae626e pyglet/media/procedural.py
--- a/pyglet/media/procedural.py Fri Jun 29 18:11:45 2012 +1000
+++ b/pyglet/media/procedural.py Fri Jun 29 18:59:10 2012 -0300
@@ -55,7 +55,7 @@
if self._bytes_per_sample == 2:
self._max_offset &= 0xfffffffe
- def _get_audio_data(self, bytes):
+ def get_audio_data(self, bytes):
bytes = min(bytes, self._max_offset - self._offset)
if bytes <= 0:
return None
diff -r 7fe0b5ae626e tests/media/PLAYER_EOS_NEXT.py
--- a/tests/media/PLAYER_EOS_NEXT.py Fri Jun 29 18:11:45 2012 +1000
+++ b/tests/media/PLAYER_EOS_NEXT.py Fri Jun 29 18:59:10 2012 -0300
@@ -12,6 +12,7 @@
from pyglet import media
from pyglet.media import procedural
+import pyglet
class TEST_CASE(unittest.TestCase):
def test_method(self):
@@ -23,7 +24,7 @@
player.play()
while player.source:
- player.dispatch_events()
+ pyglet.app.platform_event_loop.dispatch_posted_events()
if __name__ == '__main__':
unittest.main()
diff -r 7fe0b5ae626e tests/media/PLAYER_PAUSE.py
--- a/tests/media/PLAYER_PAUSE.py Fri Jun 29 18:11:45 2012 +1000
+++ b/tests/media/PLAYER_PAUSE.py Fri Jun 29 18:59:10 2012 -0300
@@ -14,6 +14,7 @@
from pyglet import media
from pyglet.media import procedural
+import pyglet
class TEST_CASE(unittest.TestCase):
def test_method(self):
@@ -31,7 +32,7 @@
if stage == 1 and time.time() - start_time > 0.75:
player.play()
stage = 2
- player.dispatch_events()
+ pyglet.app.platform_event_loop.dispatch_posted_events()
if __name__ == '__main__':
unittest.main()
diff -r 7fe0b5ae626e tests/media/PLAYER_PAUSE_QUEUE.py
--- a/tests/media/PLAYER_PAUSE_QUEUE.py Fri Jun 29 18:11:45 2012 +1000
+++ b/tests/media/PLAYER_PAUSE_QUEUE.py Fri Jun 29 18:59:10 2012 -0300
@@ -12,6 +12,7 @@
from pyglet import media
from pyglet.media import procedural
+import pyglet
class TEST_CASE(unittest.TestCase):
def test_method(self):
@@ -21,7 +22,7 @@
player.queue(source)
while player.source:
- player.dispatch_events()
+ pyglet.app.platform_event_loop.dispatch_posted_events()
player.play()
if __name__ == '__main__':
diff -r 7fe0b5ae626e tests/media/PLAYER_PLAY_QUEUE.py
--- a/tests/media/PLAYER_PLAY_QUEUE.py Fri Jun 29 18:11:45 2012 +1000
+++ b/tests/media/PLAYER_PLAY_QUEUE.py Fri Jun 29 18:59:10 2012 -0300
@@ -12,6 +12,7 @@
from pyglet import media
from pyglet.media import procedural
+import pyglet
class TEST_CASE(unittest.TestCase):
def test_method(self):
@@ -21,7 +22,7 @@
player.queue(source)
while player.source:
- player.dispatch_events()
+ pyglet.app.platform_event_loop.dispatch_posted_events()
if __name__ == '__main__':
unittest.main()
diff -r 7fe0b5ae626e tests/media/PLAYER_QUEUE_PLAY.py
--- a/tests/media/PLAYER_QUEUE_PLAY.py Fri Jun 29 18:11:45 2012 +1000
+++ b/tests/media/PLAYER_QUEUE_PLAY.py Fri Jun 29 18:59:10 2012 -0300
@@ -12,6 +12,7 @@
from pyglet import media
from pyglet.media import procedural
+import pyglet
class TEST_CASE(unittest.TestCase):
def test_method(self):
@@ -21,7 +22,7 @@
player.play()
while player.source:
- player.dispatch_events()
+ pyglet.app.platform_event_loop.dispatch_posted_events()
if __name__ == '__main__':
unittest.main()
diff -r 7fe0b5ae626e tests/media/PLAYER_STATIC_STATIC.py
--- a/tests/media/PLAYER_STATIC_STATIC.py Fri Jun 29 18:11:45 2012 +1000
+++ b/tests/media/PLAYER_STATIC_STATIC.py Fri Jun 29 18:59:10 2012 -0300
@@ -12,6 +12,7 @@
from pyglet import media
from pyglet.media import procedural
+import pyglet
class TEST_CASE(unittest.TestCase):
def test_method(self):
@@ -23,7 +24,7 @@
player.play()
while player.source:
- player.dispatch_events()
+ pyglet.app.platform_event_loop.dispatch_posted_events()
if __name__ == '__main__':
unittest.main()