HARD Problem: Thread Error after streaming
#1
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:ConfusedtaticThread : 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
Reply
#2
well first theres no need to initialize the window, so get rid of all

Code:
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.

Code:
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)
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#3
Big Grin 
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
Reply

Logout Mark Read Team Forum Stats Members Help
HARD Problem: Thread Error after streaming0