disable cuesheet (resume) until in understand the libdvdnav :)
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 22 Apr 2008 21:57:33 +0000 (21:57 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 22 Apr 2008 21:57:33 +0000 (21:57 +0000)
lib/python/Plugins/Extensions/DVDPlayer/plugin.py
lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp

index a44d042..45c5dde 100644 (file)
@@ -147,9 +147,10 @@ class ChapterZap(Screen):
                self.Timer.callback.append(self.keyOK)
                self.Timer.start(3000, True)
 
                self.Timer.callback.append(self.keyOK)
                self.Timer.start(3000, True)
 
-class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSupport, InfoBarPVRState, InfoBarShowHide, HelpableScreen):
-       ALLOW_SUSPEND = True
-       ENABLE_RESUME_SUPPORT = True
+class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarPVRState, InfoBarShowHide, HelpableScreen):
+#InfoBarCueSheetSupport, 
+#      ALLOW_SUSPEND = True
+#      ENABLE_RESUME_SUPPORT = True
        
        skin = """
        <screen name="DVDPlayer" flags="wfNoBorder" position="0,380" size="720,160" title="InfoBar" backgroundColor="transparent" >
        
        skin = """
        <screen name="DVDPlayer" flags="wfNoBorder" position="0,380" size="720,160" title="InfoBar" backgroundColor="transparent" >
@@ -222,7 +223,7 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarC
                Screen.__init__(self, session)
                InfoBarBase.__init__(self)
                InfoBarNotifications.__init__(self)
                Screen.__init__(self, session)
                InfoBarBase.__init__(self)
                InfoBarNotifications.__init__(self)
-               InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
+#              InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
                InfoBarShowHide.__init__(self)
                HelpableScreen.__init__(self)
                self.save_infobar_seek_config()
                InfoBarShowHide.__init__(self)
                HelpableScreen.__init__(self)
                self.save_infobar_seek_config()
@@ -531,11 +532,25 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarC
                self.restore_infobar_seek_config()
                self.session.nav.playService(self.oldService)
 
                self.restore_infobar_seek_config()
                self.session.nav.playService(self.oldService)
 
-       def playLastCB(self, answer): # overwrite infobar cuesheet function
-               print "playLastCB", answer, self.resume_point
-#              if answer == True:
-#                      self.doSeek(self.resume_point)
-               self.hideAfterResume()
+#      def playLastCB(self, answer): # overwrite infobar cuesheet function
+#              print "playLastCB", answer, self.resume_point
+#              pos = self.resume_point
+#              title = self.resume_point % 90000
+#              pos -= title
+#              chapter = title % 256
+#              title /= 256
+#              print "pos", pos, "title", title, "chapter", chapter
+#              if self.service:
+#                      seek = self.service.seek()
+#                      if title != 1:
+#                              seek.seekTitle(title)
+#                              self.resume_state = 1
+#                      elif chapter != 1:
+#                              seek.seekChapter(chapter)
+#                              self.resume_state = 2
+#                      else:
+#                              seek.seekTo(pos)
+#              self.hideAfterResume()
 
        def showAfterCuesheetOperation(self):
                if not self.in_menu:
 
        def showAfterCuesheetOperation(self):
                if not self.in_menu:
index 12d1405..91b940a 100644 (file)
@@ -205,20 +205,13 @@ void eServiceDVD::gotMessage(int what)
                {
                        static struct ddvd_time last_info;
                        struct ddvd_time info;
                {
                        static struct ddvd_time last_info;
                        struct ddvd_time info;
-                       eDebug("DVD_SHOWOSD_TIME!");
+//                     eDebug("DVD_SHOWOSD_TIME!");
                        ddvd_get_last_time(m_ddvdconfig, &info);
                        ddvd_get_last_time(m_ddvdconfig, &info);
-                       int spu_id;
-                       uint16_t spu_lang;
-                       ddvd_get_last_spu(m_ddvdconfig, &spu_id, &spu_lang);
                        if ( info.pos_chapter != last_info.pos_chapter )
                        if ( info.pos_chapter != last_info.pos_chapter )
-                       {
                                m_event(this, evUser+8); // chapterUpdated
                                m_event(this, evUser+8); // chapterUpdated
-                       }
                        if ( info.pos_title != last_info.pos_title )
                        if ( info.pos_title != last_info.pos_title )
-                       {
                                m_event(this, evUser+9); // titleUpdated
                                m_event(this, evUser+9); // titleUpdated
-                       }
-                       ddvd_get_last_time(m_ddvdconfig, &last_info);
+                       memcpy(&last_info, &info, sizeof(struct ddvd_time));
                        break;
                }
                case DDVD_SHOWOSD_TITLESTRING:
                        break;
                }
                case DDVD_SHOWOSD_TITLESTRING:
@@ -286,7 +279,10 @@ RESULT eServiceDVD::stop()
                pos += info.pos_minutes * 60;
                pos += info.pos_seconds;
                pos *= 90000;
                pos += info.pos_minutes * 60;
                pos += info.pos_seconds;
                pos *= 90000;
+               pos += info.pos_title * 256;
+               pos += info.pos_chapter;
                m_cue_pts = pos;
                m_cue_pts = pos;
+               eDebug("POS %llu\n", m_cue_pts);
        }
        saveCuesheet();
        return 0;
        }
        saveCuesheet();
        return 0;
@@ -566,8 +562,8 @@ RESULT eServiceDVD::seekTo(pts_t to)
        cur = info.pos_hours * 3600;
        cur += info.pos_minutes * 60;
        cur += info.pos_seconds;
        cur = info.pos_hours * 3600;
        cur += info.pos_minutes * 60;
        cur += info.pos_seconds;
-       eDebug("seekTo %lld, cur %d, diff %lld", to, cur, cur - to);
-       ddvd_skip_seconds(m_ddvdconfig, cur - to);
+       eDebug("seekTo %lld, cur %d, diff %lld", to, cur, to - cur);
+       ddvd_skip_seconds(m_ddvdconfig, to - cur);
        return 0;
 }
 
        return 0;
 }