disallow non-mpeg2 video streams for dvdburn
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Mon, 15 Sep 2008 10:40:30 +0000 (10:40 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Mon, 15 Sep 2008 10:40:30 +0000 (10:40 +0000)
lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py
lib/python/Plugins/Extensions/DVDBurn/TitleList.py

index 75a53a0..016eb71 100644 (file)
@@ -1,6 +1,6 @@
 from Plugins.Extensions.CutListEditor.plugin import CutListEditor
 from Components.ServiceEventTracker import ServiceEventTracker
-from enigma import iPlayableService
+from enigma import iPlayableService, iServiceInformation
 
 class TitleCutter(CutListEditor):
        def __init__(self, session, t):
@@ -10,17 +10,15 @@ class TitleCutter(CutListEditor):
                self.t = t
                self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
                        {
-                               iPlayableService.evUpdatedInfo: self.getAudioTracks,
+                               iPlayableService.evUpdatedInfo: self.getPMTInfo,
                                iPlayableService.evCuesheetChanged: self.refillList
                        })
                self.onExecBegin.remove(self.showTutorial)
 
-       def getAudioTracks(self):
+       def getPMTInfo(self):
                service = self.session.nav.getCurrentService()
                audio = service and service.audioTracks()
                n = audio and audio.getNumberOfTracks() or 0
-               print "self.t", self.t
-               print "self.t.audiotracks", self.t.audiotracks
                if n > 0:
                        for x in range(n):
                                i = audio.getTrackInfo(x)
@@ -29,7 +27,11 @@ class TitleCutter(CutListEditor):
                                if description == "MPEG":
                                        description = "MP2"
                                self.t.audiotracks.append((language, description))
-               print "audiotracks", self.t.audiotracks
+               print "[DVDBurn getAudioTracks]", self.t.audiotracks
+               sVideoType = service.info().getInfo(iServiceInformation.sVideoType)
+               print "[DVDBurn getVideoType]", sVideoType
+               if sVideoType != 0:
+                       self.close(False)
 
        def exit(self):
                self.session.nav.stopService()
index fc4460e..f446770 100644 (file)
@@ -134,6 +134,9 @@ class TitleList(Screen):
 
        def removeCurrentTitle(self):
                title = self.getCurrentTitle()
+               self.removeTitle(title)
+       
+       def removeTitle(self, title):
                if title is not None:
                        self.project.titles.remove(title)
                        self.updateTitleList()
@@ -218,11 +221,14 @@ class TitleList(Screen):
                                self.session.openWithCallback(self.titleEditDone, TitleCutter.TitleCutter, t)
 
        def titleEditDone(self, cutlist):
-               t = self.current_edit_title
-               t.cuesheet = cutlist
-               t.produceFinalCuesheet()
-               print "title edit of %s done, resulting cutlist:" % (t.source.toString()), t.cutlist, "chaptermarks:", t.chaptermarks
-               self.updateTitleList()
+               if cutlist != False:
+                       t = self.current_edit_title
+                       t.cuesheet = cutlist
+                       t.produceFinalCuesheet()
+                       self.updateTitleList()
+               else:
+                       self.session.open(MessageBox,text = _("The DVD standard doesn't support H.264 (HDTV) video streams!"),type = MessageBox.TYPE_ERROR)
+                       self.removeTitle(self.current_edit_title)
 
        def leave(self):
                self.close()