inhibit showing infobar on chapter change, don't load cuesheet if user says no in...
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Fri, 15 Aug 2008 20:54:31 +0000 (20:54 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Fri, 15 Aug 2008 20:54:31 +0000 (20:54 +0000)
for resume if stop position was in a menu

lib/python/Plugins/Extensions/DVDPlayer/plugin.py
lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp

index 1db8737..79a13e6 100644 (file)
@@ -246,6 +246,8 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                self["audioLabel"] = Label("n/a")
                self["subtitleLabel"] = Label("")
                self["chapterLabel"] = Label("")
                self["audioLabel"] = Label("n/a")
                self["subtitleLabel"] = Label("")
                self["chapterLabel"] = Label("")
+               self.last_audioTuple = None
+               self.last_subtitleTuple = None
                self.totalChapters = 0
                self.currentChapter = 0
                self.totalTitles = 0
                self.totalChapters = 0
                self.currentChapter = 0
                self.totalTitles = 0
@@ -424,8 +426,9 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                print "AudioInfoAvail ", repr(audioTuple)
                audioString = "%d: %s (%s)" % (audioTuple[0],audioTuple[1],audioTuple[2])
                self["audioLabel"].setText(audioString)
                print "AudioInfoAvail ", repr(audioTuple)
                audioString = "%d: %s (%s)" % (audioTuple[0],audioTuple[1],audioTuple[2])
                self["audioLabel"].setText(audioString)
-               if not self.in_menu:
+               if audioTuple != self.last_audioTuple and not self.in_menu:
                        self.doShow()
                        self.doShow()
+               self.last_audioTuple = audioTuple
 
        def __osdSubtitleInfoAvail(self):
                subtitleTuple = self.service.info().getInfoObject(iServiceInformation.sUser+7)
 
        def __osdSubtitleInfoAvail(self):
                subtitleTuple = self.service.info().getInfoObject(iServiceInformation.sUser+7)
@@ -434,8 +437,9 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                if subtitleTuple[0] is not 0:
                        subtitleString = "%d: %s" % (subtitleTuple[0],subtitleTuple[1])
                self["subtitleLabel"].setText(subtitleString)
                if subtitleTuple[0] is not 0:
                        subtitleString = "%d: %s" % (subtitleTuple[0],subtitleTuple[1])
                self["subtitleLabel"].setText(subtitleString)
-               if not self.in_menu:
+               if subtitleTuple != self.last_subtitleTuple and not self.in_menu:
                        self.doShow()
                        self.doShow()
+               self.last_subtitleTuple = subtitleTuple
 
        def __chapterUpdated(self):
                self.currentChapter = self.service.info().getInfo(iServiceInformation.sCurrentChapter)
 
        def __chapterUpdated(self):
                self.currentChapter = self.service.info().getInfo(iServiceInformation.sCurrentChapter)
@@ -583,7 +587,7 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
 
        def playLastCB(self, answer): # overwrite infobar cuesheet function
                print "playLastCB", answer, self.resume_point
 
        def playLastCB(self, answer): # overwrite infobar cuesheet function
                print "playLastCB", answer, self.resume_point
-               if self.service:
+               if self.service and answer == True:
                        seek = self.service.seek()
                        seek.seekTo(self.resume_point)
                self.hideAfterResume()
                        seek = self.service.seek()
                        seek.seekTo(self.resume_point)
                self.hideAfterResume()
index a756e75..cdb01d3 100644 (file)
@@ -739,21 +739,26 @@ void eServiceDVD::saveCuesheet()
 {
        eDebug("eServiceDVD::saveCuesheet()");
 
 {
        eDebug("eServiceDVD::saveCuesheet()");
 
-       struct ddvd_time info;
-       ddvd_get_last_time(m_ddvdconfig, &info);
-       if ( info.pos_chapter < info.end_chapter )
+       struct ddvd_resume resume_info;
+       ddvd_get_resume_pos(m_ddvdconfig, &resume_info);
+
+       if (resume_info.title)
        {
        {
+               struct ddvd_time info;
+               ddvd_get_last_time(m_ddvdconfig, &info);
                pts_t pos;
                pos = info.pos_hours * 3600;
                pos += info.pos_minutes * 60;
                pos += info.pos_seconds;
                pos *= 90000;
                m_cue_pts = pos;
                pts_t pos;
                pos = info.pos_hours * 3600;
                pos += info.pos_minutes * 60;
                pos += info.pos_seconds;
                pos *= 90000;
                m_cue_pts = pos;
+               eDebug("ddvd_get_resume_pos resume_info.title=%d, chapter=%d, block=%lu, audio_id=%d, audio_lock=%d, spu_id=%d, spu_lock=%d  (pts=%llu)",resume_info.title,resume_info.chapter,resume_info.block,resume_info.audio_id, resume_info.audio_lock, resume_info.spu_id, resume_info.spu_lock,m_cue_pts);
+       }
+       else
+       {
+               eDebug("we're in a menu or somewhere else funny. so save cuesheet with pts=0");
+               m_cue_pts = 0;
        }
        }
-
-       struct ddvd_resume resume_info;
-       ddvd_get_resume_pos(m_ddvdconfig, &resume_info);
-       eDebug("ddvd_get_resume_pos resume_info.title=%d, chapter=%d, block=%lu, audio_id=%d, audio_lock=%d, spu_id=%d, spu_lock=%d  (pts=%llu)",resume_info.title,resume_info.chapter,resume_info.block,resume_info.audio_id, resume_info.audio_lock, resume_info.spu_id, resume_info.spu_lock,m_cue_pts);
 
        char filename[128];
        if ( m_ddvd_titlestring[0] != '\0' )
 
        char filename[128];
        if ( m_ddvd_titlestring[0] != '\0' )