Revision: c9188efc2e30
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Sun May 11 19:43:44 2014 UTC
Log: Allow queueing SourceGroups
http://code.google.com/p/pyglet/source/detail?r=c9188efc2e30
Modified:
/pyglet/media/__init__.py
=======================================
--- /pyglet/media/__init__.py Thu Apr 17 16:35:44 2014 UTC
+++ /pyglet/media/__init__.py Sun May 11 19:43:44 2014 UTC
@@ -966,15 +966,18 @@
self._paused_time = 0.0
def queue(self, source):
- if (self._groups and
- source.audio_format == self._groups[-1].audio_format and
- source.video_format == self._groups[-1].video_format):
- self._groups[-1].queue(source)
+ if isinstance(source, SourceGroup):
+ self._groups.append(source)
else:
- group = SourceGroup(source.audio_format, source.video_format)
- group.queue(source)
- self._groups.append(group)
- self._set_eos_action(self._eos_action)
+ if (self._groups and
+ source.audio_format == self._groups[-1].audio_format and
+ source.video_format == self._groups[-1].video_format):
+ self._groups[-1].queue(source)
+ else:
+ group = SourceGroup(source.audio_format,
source.video_format)
+ group.queue(source)
+ self._groups.append(group)
+ self._set_eos_action(self._eos_action)
self._set_playing(self._playing)