- Further cleaning of the streaming code

- Added codec check in video controller
This commit is contained in:
noisymime 2008-02-14 03:43:52 +00:00
parent b75d5c80f3
commit 42d3628579
2 changed files with 4 additions and 3 deletions

View File

@ -86,12 +86,13 @@ class VideoController:
if t == gst.MESSAGE_ELEMENT:
#This occurs when an invalid codec is attempted to be played
#Need to insert some form of message to the user here
#print "Element: " + message.structure.to_string()
if self.player.glossMgr.debug: print "GStreamer Bus msg: " + message.structure.to_string()
struc = message.structure
if struc is None:
return
if struc.get_name() == "missing-plugin":
print "GStreamer Error (missing-plugin): " + message.structure.to_string()
self.isPlaying = False
self.video_texture.set_playing(False)
self.player.stop_video()

View File

@ -209,11 +209,11 @@ class MythBackendConnection(threading.Thread):
#This tries to optimise the request size
if (num_bytes == request_size) and (request_size < max_request_size):
request_size = request_size + request_size_step
request_size += request_size_step
if request_size > max_request_size:
request_size = max_request_size
elif (request_size > request_size_step) and (num_bytes != request_size):
request_size = request_size - request_size_step
request_size -= request_size_step
print "Ending playback"