(defvar sdt-monitor-period 5000)(defvar cat-monitor-period 5000)(defvar sdt-timeout-running nil)(defun sdt-timeout-fun (x)(cancel-timer 'sdt-timeout)(setf sdt-timeout-running nil)(set-section-valid 'sdt nil)(make-event 'sdt-timeout))(defun start-sdt-monitor ()(cancel-timer 'sdt-timeout)(setf sdt-timeout-running nil)(section-open 'sdt-mon)(section-disable 'sdt-mon)(section-filter 'sdt-mon
:source 'tsport
:pid (get-section-pid 'sdt)
:length (get-section-length 'sdt)
:filter (get-section-filter 'sdt)
:mask (get-section-mask 'sdt)
:elength 0)(section-enable 'sdt-mon)(setf sdt-timeout-running t)(set-timer (function sdt-timeout-fun)
'sdt-timeout
nil
1
sdt-monitor-period))(defun stop-sdt-monitor ()(cancel-timer 'sdt-timeout)(setf sdt-timeout-running nil)(section-close 'sdt-mon))(register-section 'sdt
#'(lambda (data)(cancel-timer 'sdt-timeout)(setf sdt-inited t)(if (get-section-valid 'sdt)(make-event 'sdt-update)(progn
(set-section-valid 'sdt t)(make-event 'sdt-valid)))))(register-section 'sdt-mon
#'(lambda (data)(section-disable 'sdt-mon)(setf sdt-timeout-running nil)(cancel-timer 'sdt-timeout)))(register-node 'sdt-request
#'(lambda ()
t)
#'(lambda ()(unless (get-section-valid 'sdt)(section-open 'sdt)(section-disable 'sdt)(set-section-pid 'sdt #x11)(setf (nth 0 (get-section-filter 'sdt)) #x42)(setf (nth 0 (get-section-mask 'sdt)) 0)(section-filter 'sdt
:type "version"
:source 'tsport
:pid (get-section-pid 'sdt)
:length (get-section-length 'sdt)
:filter (get-section-filter 'sdt)
:mask (get-section-mask 'sdt)
:elength (get-section-elength 'sdt)
:efilter (get-section-efilter 'sdt)
:emask (get-section-emask 'sdt))(section-enable 'sdt)(setf sdt-requested t))(start-sdt-monitor))
#'(lambda ()(section-close 'sdt)(set-section-valid 'sdt nil)(setf sdt-requested nil)(stop-sdt-monitor)))(defun cat-timeout-fun (x)(cancel-timer 'cat-timeout)(set-section-valid 'cat nil)(make-event 'cat-timeout))(defun start-cat-monitor ()(cancel-timer 'cat-timeout)(section-open 'cat-mon)(section-disable 'cat-mon)(section-filter 'cat-mon
:source 'tsport
:pid (get-section-pid 'cat)
:length (get-section-length 'cat)
:filter (get-section-filter 'cat)
:mask (get-section-mask 'cat)
:elength 0)(section-enable 'cat-mon)(set-timer (function cat-timeout-fun)
'cat-timeout
nil
1
cat-monitor-period))(defun stop-cat-monitor ()(cancel-timer 'cat-timeout)(section-close 'cat-mon))(register-section 'cat
#'(lambda (data)(cancel-timer 'cat-timeout)(setf cat-inited t)(if (get-section-valid 'cat)(make-event 'cat-update)(progn
(set-section-valid 'cat t)(make-event 'cat-valid)))))(register-section 'cat-mon
#'(lambda (data)(section-disable 'cat-mon)(cancel-timer 'cat-timeout)))(register-node 'cat-request
#'(lambda ()
t)
#'(lambda ()(when (and (eq current-network SC_TV_OVER_IP)(not (get-section-valid 'cat)))(section-open 'cat)(section-disable 'cat)(set-section-pid 'cat #x01)(setf (nth 0 (get-section-filter 'cat)) #x01)(setf (nth 0 (get-section-mask 'cat)) 0)(section-filter 'cat
:type "version"
:source 'tsport
:pid (get-section-pid 'cat)
:length (get-section-length 'cat)
:filter (get-section-filter 'cat)
:mask (get-section-mask 'cat)
:elength (get-section-elength 'cat)
:efilter (get-section-efilter 'cat)
:emask (get-section-emask 'cat))(section-enable 'cat)(start-cat-monitor)))
#'(lambda ()(section-close 'cat)(set-section-valid 'cat nil)(stop-cat-monitor)))
