|
|
@@ -123,8 +123,6 @@ class MPEGTS(FSObject, VideoItem): |
|
|
|
self.tvct = kwargs['tvct'] |
|
|
|
del kwargs['tvct'] |
|
|
|
|
|
|
|
log.msg('MPEGTS tvct:', self.tvct) |
|
|
|
|
|
|
|
kwargs['content'] = MPEGTSResource( |
|
|
|
mpegts.iteravpids(mpegts.TSPStream(open(path)), |
|
|
|
sum(mpegts.getaudiovideopids(self.tvct['PMT']), []))) |
|
|
@@ -176,18 +174,14 @@ class MultiMPEGTS(FSObject, StorageFolder): |
|
|
|
StorageFolder.doUpdate(self) |
|
|
|
|
|
|
|
def detectmpegts(path, fobj): |
|
|
|
try: |
|
|
|
f = mpegts.TSPStream(_LimitedFile(path, size= 2*1024*1024)) |
|
|
|
tvct = mpegts.GetTVCT(f) |
|
|
|
except: |
|
|
|
import traceback |
|
|
|
traceback.print_exc(file=log.logfile) |
|
|
|
raise |
|
|
|
|
|
|
|
log.msg('tvct:', tvct) |
|
|
|
f = mpegts.TSPStream(_LimitedFile(path, size= 2*1024*1024)) |
|
|
|
tvct = mpegts.GetTVCT(f) |
|
|
|
|
|
|
|
if len(tvct['channels']) == 1: |
|
|
|
return None, None |
|
|
|
return MPEGTS, { 'path': path, 'tvct': tvct['channels'][0] } |
|
|
|
# We might reenable this once we have pid filtering working |
|
|
|
# fast enough. |
|
|
|
#return MPEGTS, { 'path': path, 'tvct': tvct['channels'][0] } |
|
|
|
elif len(tvct['channels']) > 1: |
|
|
|
return MultiMPEGTS, { 'path': path } |
|
|
|
|
|
|
|