Hi Florian Might be that the hard drive is too slow.
I have implemented a channels arrangement inside my four viewable area pyglet demo, one of issue I came across was the need to limit the number of channels due to the hard drive being unable keep up with the amount of data requested. Also the decoding requirements are may be too great. If you can, try another video file of a smaller resolution/quality. What type of video are you using? I have no experience with the mac book air, but is it reasonably fast? James On Mon, Nov 30, 2009 at 2:06 AM, Florian Bösch <[email protected]> wrote: > I don't know if this is a universal problem, but if I simply do > pyglet.media.play(somesource) several times, my macbook air almost > dies from performance issues. > > So here's what I did to solve this (maybe that seems stupid, no idea, > maybe it's useful for others) > > from pyglet import media > > class Player(object): > def __init__(self, free, busy): > self.free = free > self.busy = busy > self.player = media.Player() > self.player.push_handlers(self) > > def play(self, source): > self.player.queue(source) > if self.player.playing: > self.player.next() > else: > self.player.play() > > def on_eos(self): > self.busy.remove(self) > self.free.insert(0, self) > > class Channel(object): > def __init__(self, amount=6): > self.free = [] > self.busy = [] > for _ in range(amount): > self.free.append( > Player(self.free, self.busy) > ) > > def play(self, source): > if self.free: > player = self.free.pop() > else: > player = self.busy.pop() > self.busy.insert(0, player) > player.play(source) > > -- > > You received this message because you are subscribed to the Google Groups > "pyglet-users" group. > 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. > > > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. 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.
