[Jahshaka-cvs] openlibraries/test/openmedialib/python play.py, 1.2, 1.3
Status: Beta
Brought to you by:
jahshaka
From: Charles Y. <lil...@us...> - 2006-11-01 12:06:26
|
Update of /cvsroot/openlibraries/openlibraries/test/openmedialib/python In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18956 Modified Files: play.py Log Message: + Removal of range and some error checking [incomplete] Index: play.py =================================================================== RCS file: /cvsroot/openlibraries/openlibraries/test/openmedialib/python/play.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- play.py 31 Oct 2006 13:28:05 -0000 1.2 +++ play.py 1 Nov 2006 12:06:18 -0000 1.3 @@ -37,24 +37,25 @@ if input is not None: frame = input.fetch( ) if frame is not None: - if sdl is None: - sdl = openmedialib.create_store( "sdl:", frame ) - sdl.init( ) - openal = openmedialib.create_store( "openal:", frame ) - openal.init( ) + if openal is not None: openal.init( ) precache = [ frame ] openal.push( frame ) - for i in range( 1, input.get_frames( ) ): + i = 1 + while i < input.get_frames( ): + if sdl is None and frame.get_image( ) is not None: + sdl = openmedialib.create_store( "sdl:", frame ) + if sdl is not None: sdl.init( ) input.seek( i, False ) frame = input.fetch( ) precache.append( frame ) if i > 8: - if not sdl.push( precache.pop( 0 ) ): + if sdl is not None and not sdl.push( precache.pop( 0 ) ): break - openal.push( frame ) + if openal is not None: openal.push( frame ) + i += 1 sdl.complete( ) else: |