PDA

View Full Version : HARD Problem: Thread Error after streaming


oliv
2007-03-01, 16:48
Hi,

I'm developing my own script for streaming archived tv shows, but I have a strange error that I cannot fix.
The problem occurs after having watched a stream, the process come back to the channel window, I can click for going back, but as soon as I click on another channel program, the following error is printed in the log:

ERROR: CThread::staticThread : Access violation at 0x00ef2d8c: Reading location 0xcf1c8000

And I cannot go back to the root window, but the script is not totally freezed, because I can go up and down in the channel list..
I have tried to debug, log the error, but I cannot catch anything, I put many try and catch zone with log expression, without having something in the log.


I'm using the XBMC version 2.0.0 and 2.0.1, but I began the development under 1.0.0 and I hadn't this problem...

Can somebody help me, I don't know what to change... ?
Thanks
oli

PS:
For reproducing the error, go to canal+, then choose a program (mms), wiat that the stream start, then stop it or wait until the end... and then click on another program.... the error occurs...

http://olivier.euromobile.ch/xbox/MediaStream_0.3.zip

Nuka1195
2007-03-01, 17:53
well first theres no need to initialize the window, so get rid of all

xbmcgui.Window.__init__(self)

second your trying return from the onControl() event. What are trying to return to.

Then your tryin a try/except where it doesn't error and left with no urlToPlay.


def onControl(self, control):
if control == self.list:
program = self.programs[self.list.getSelectedPosition()]
self.program = program

#--- Choose option -----
if self.program.prooption and len(self.program.prooption) > 1 :
dialog = xbmcgui.Dialog()
self.program.prooptionIdx = dialog.select("Select Option", self.program.prooption)

#--- Choose Date -----
selectDate = None
# Ask for the diffusion dates when defined
diffDates = program.getDiffusionDates()
if diffDates and len(diffDates) > 1:
diffsStrs = []

# fill the date string
for date in diffDates:

# TODO test availability with a ping ...
diffsStrs.append(date.strftime('%d/%m/%Y')) #'%A %d %B %Y'))
dialog = xbmcgui.Dialog()
dateIdx = dialog.select("Select a Date", diffsStrs)
selectDate = diffDates[dateIdx]
# get the selected base url
urlemission = program.getFullURL(selectDate)
urlToPlay = urlemission

#print 'URLBASE: ' + urlemission


if urlemission.endswith('.rm') and urlemission.endswith('.ram') :
try:
urlToPlay = ""
#read the redirected link for real especially
urlredirect= urllib.urlopen(urlemission).read()
#print 'URLRED: ' + urlredirect
# redirect possible try to search if rm
#idx = urlredirect.find("&cloakport")
idx = urlredirect.find('?')
if ( idx ):
urlToPlay = urlredirect[:idx]
else:
urlToPlay = urlredirect

except:
#print 'redirect problem, use classic'
lili=''

monplayer = xbmc.Player()
monplayer.play(urlToPlay)

#xbmc.Player().play(urlToPlay)

oliv
2007-03-01, 22:20
YEAHHH

Thanks a lot, I was searching at a bad place... and I didn't know that a return was not allowed in an event method...

I really thanks you.. for your help and for time you took...
Best regards
Oliv