add catch and retries around dlna url

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2406 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2015-04-21 22:08:41 +00:00
parent 677bc95882
commit 547f825f54
2 changed files with 15 additions and 4 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 1.2.2-6
Version: 1.2.2-7
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.35-2),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.0),hmt(>=2.0.3),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.3)

View File

@ -161,9 +161,9 @@ proc {system dlnadb} {} {
return ""
}
proc {system dlnaurl} {file {urlbase ""}} {
proc {system _dlnaurl} {file urlbase} {
set mime "video/ts"
if {[catch {set db [sqlite3.open [system dlnadb]]}]} { return {} }
set db [sqlite3.open [system dlnadb]]
set muri [$db query {
select tblresource.mimetype, contenturi
from tblresource join tblmedia using (mediaid)
@ -183,12 +183,23 @@ proc {system dlnaurl} {file {urlbase ""}} {
$db close
if {$urlbase eq ""} { set urlbase [system ip] }
set url "http://${urlbase}:9000/web/$xuri"
return [list $url $mime]
}
proc {system dlnaurl} {file {urlbase ""}} {
if {$urlbase eq ""} { set urlbase [system ip] }
set retries 5
set ret {}
while {$retries > 0 && [\
catch {set ret [system _dlnaurl $file $urlbase]}]} {
incr retries -1
sleep 1
}
return $ret
}
proc {system dlnahelper} {file {urlbase ""}} {
set dir /mnt/hd2/mod/.dlnahelper
require lock