Check http availability before open a mpg

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
afeno Offline
Junior Member
Posts: 31
Joined: Oct 2004
Reputation: 0
Location: Barcelona
Sad   
Post: #1
hello experts,
i have a problem with one script which try to open a mpg via http.
sometimes the http server is not ready to send the information and the xbmc fails to open the file. (normal)
the problem is that the xbmc hungs everytime this happens.

here is the log to be clearer:

23-12-2005 18:09:32 debug item: http://192.168.1.104:8000/dvbcore.mpg
23-12-2005 18:09:32 info loading skin file: dialogprogress.xml
23-12-2005 18:09:32 info mplayer play:http://192.168.1.104:8000/dvbcore.mpg cachesize:2048
23-12-2005 18:09:32 debug initializing fs_seg..
23-12-2005 18:09:32 debug fs segment @ 0x768220
23-12-2005 18:09:33 debug   msg: set audio functions called
23-12-2005 18:09:33 debug   msg: done
23-12-2005 18:09:33 info flipping bi-directional subtitles disabled
23-12-2005 18:09:33 debug   msg:mplayer_init()
23-12-2005 18:09:33 debug   msg:enable mplayer osd
23-12-2005 18:09:33 debug   msg:mplayer dev-cvs-051007-22:19-3.4.4 © 2000-2004 mplayer team
23-12-2005 18:09:33 debug   msg:cpu: intel celeron 2/pentium iii coppermine,geyserville
23-12-2005 18:09:33 debug   msg:(family: 6, stepping: 10)
23-12-2005 18:09:33 debug   msg:detected cache-line size is 32 bytes
23-12-2005 18:09:33 debug   msg:cpuflags:  mmx: 1 mmx2: 1 3dnow: 0 3dnow2: 0 sse: 0 sse2: 0
23-12-2005 18:09:33 debug   msg:compiled for x86 cpu with extensions:
23-12-2005 18:09:33 debug   msg: mmx
23-12-2005 18:09:33 debug   msg: mmx2
23-12-2005 18:09:33 debug   msg: sse
23-12-2005 18:09:33 debug   msg:
23-12-2005 18:09:33 debug   msg:
23-12-2005 18:09:33 debug   msg:creating config file: q:\system\players\mplayer\config
23-12-2005 18:09:33 debug   msg:
23-12-2005 18:09:33 debug   msg:88 audio & 199 video codecs
23-12-2005 18:09:33 debug   msg:mplayer_open_file(http://192.168.1.104:8000/dvbcore.mpg)
23-12-2005 18:09:33 info stating file http://192.168.1.104:8000/dvbcore.mpg.conf
23-12-2005 18:09:33 info stating file q:\system\players\mplayer\dvbcore.mpg.conf
23-12-2005 18:09:33 debug   msg:playing http://192.168.1.104:8000/dvbcore.mpg.
23-12-2005 18:09:33 debug   msg:find subtitles
23-12-2005 18:09:33 debug   msg:auto open z:\subtitle
23-12-2005 18:09:33 debug   msg:protocol:http
23-12-2005 18:09:33 debug   msg:open stream protocol:http
23-12-2005 18:09:33 debug   msg:connecting to server 192.168.1.104[192.168.1.104]:8000 ...
23-12-2005 18:09:33 debug   msg:cache size set to 2048 kbytes
23-12-2005 18:09:33 debug   msg:connected to server: 192.168.1.104
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:33 debug   msg: cache fill:  0.00% (0 bytes)
23-12-2005 18:09:34 debug   msg:stream_enable_cache() eof detected
23-12-2005 18:09:34 error cmplayer::openfile() http://192.168.1.104:8000/dvbcore.mpg failed
23-12-2005 18:09:34 debug   msg: mplayer_close_file()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:34 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()
23-12-2005 18:09:35 error exception in cdlgcache::process()

.....
....
..

xbmc hunged! Sad

my question is how can avoid this?
it's possible to check if the information is ready? and then open the mpg.
or it's possible to rise an exception when the first error happens? (23-12-2005 18:09:34 error cmplayer::openfile() http://192.168.1.104:8000/dvbcore.mpg failed)
how can avoid this issue?

thanks to everybody for your help.

best regards,

alfredo.
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #2
did you set a timeout?

Quote:import socket
socket.setdefaulttimeout(5.0) #seconds

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
afeno Offline
Junior Member
Posts: 31
Joined: Oct 2004
Reputation: 0
Location: Barcelona
Post: #3
i have just tried and it doesn't work. it seems that the xbmc hungs before the timeout.
i just get the caching progress bar (empty) and then it hungs.
is it possible to retrieve manually some http data to test if the connection is available? (before play the mpg with play())

all this is to improve the mytheatre script.
this happens when i try to see a satellite channel and signal is not ready yet from the server pc

thanks
regards,.
alfredo.
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #4
you could do a urlopen for a page you know exists and read in the results.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
afeno Offline
Junior Member
Posts: 31
Joined: Oct 2004
Reputation: 0
Location: Barcelona
Post: #5
the webpage always exist.
the problem is when the mpg is not ready form the satellite...
is it possible to do a urlopen of a http:/____.mpg? (to test it)

thanks
regards,
alfredo.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #6
does running playmedia via ftp, the webserver, or the skin built in command:

xbmc.playmedia(http://192.168.0.1/blah.mpg)

cause the same issues? if so, i'll take a look into it and see why the dlg cache is screwing up.

cheers,
jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
afeno Offline
Junior Member
Posts: 31
Joined: Oct 2004
Reputation: 0
Location: Barcelona
Post: #7
hi,
first of all thanks for your concerns about this issue.

yes exactly the same is happening with playmedia()

if you want to test this error by yourself try to open a mpg file via http with this command:
[url=http://192.168.1.22/xbmccmds/xbmchttp?command=execbuiltin&parameter=xbmc.playmedia(http://192.168.1.1/test.mpg)]http://192.168.1.22/xbmccmd....ia(http[/url]

where test.mpg exist in the web server but it´s not a valid mpg file.
(just create a text file called test.mpg)

if the file doesn´t exist in the web server -> it´s ok
if the file is completed -> it´s ok
if the file is not completed yet -> xbmc crash.

09-01-2006 20:57:22 error exception in cdlgcache::process()
09-01-2006 20:57:22 error exception in cdlgcache::process()
09-01-2006 20:57:22 fatal exception_access_violation (0xc0000005)
at 0x0017c91c
09-01-2006 20:57:22 fatal exception_access_violation (0xc0000005)
at 0x0017c91c

thanks again for your help.

best regards,

alfredo.
find quote