From d034cf9d1f99bc0086506922cba9fb117868b4a4 Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Mon, 18 Aug 2008 12:02:14 +0000 Subject: [PATCH 1/1] filebrowser now ends up in previous directory again after playing a dvd stucture, fix issue where service wouldn't unpause if cuesheet is corrupt --- .../Plugins/Extensions/DVDPlayer/plugin.py | 20 +++++++++++++------ .../Extensions/DVDPlayer/src/servicedvd.cpp | 4 ++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index 03f1ccc9..f9f45cbc 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -56,17 +56,24 @@ class FileBrowser(Screen): global lastpath filename = self["filelist"].getFilename() if filename is not None: - lastpath = filename[0:filename.rfind("/")] if filename.upper().endswith("VIDEO_TS/"): print "dvd structure found, trying to open..." - self.close(filename[0:-9]) + dvdpath = filename[0:-9] + lastpath = (dvdpath.rstrip("/").rsplit("/",1))[0] + print "lastpath video_ts/=", lastpath + self.close(dvdpath) + return if self["filelist"].canDescent(): # isDir self["filelist"].descent() pathname = self["filelist"].getCurrentDirectory() or "" if fileExists(pathname+"VIDEO_TS.IFO"): print "dvd structure found, trying to open..." + lastpath = (pathname.rstrip("/").rsplit("/",1))[0] + print "lastpath video_ts.ifo=", lastpath self.close(pathname) else: + lastpath = filename[0:filename.rfind("/")] + print "lastpath directory=", lastpath self.close(filename) def exit(self): @@ -456,10 +463,10 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP self.doShow() def askLeavePlayer(self): - if self.physicalDVD: - self.session.openWithCallback(self.exitCB, ChoiceBox, title=_("Leave DVD Player?"), list=[(_("Continue playing"), "play"), (_("Exit"), "exit")]) - else: - self.session.openWithCallback(self.exitCB, ChoiceBox, title=_("Leave DVD Player?"), list=[(_("Continue playing"), "play"), (_("Return to file browser"), "browser"), (_("Exit"), "exit")]) + choices = [(_("Continue playing"), "play"), (_("Exit"), "exit")] + if not self.physicalDVD: + choices.insert(1,(_("Return to file browser"), "browser")) + self.session.openWithCallback(self.exitCB, ChoiceBox, title=_("Leave DVD Player?"), list = choices) def nextAudioTrack(self): if self.service: @@ -546,6 +553,7 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP self.FileBrowserClosed(self.dvd_device) else: self.session.openWithCallback(self.FileBrowserClosed, FileBrowser) + self.physicalDVD = False def FileBrowserClosed(self, val): curref = self.session.nav.getCurrentlyPlayingServiceReference() diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp index 7a731194..da7bc5f2 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp +++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp @@ -231,6 +231,8 @@ void eServiceDVD::gotMessage(int /*what*/) ddvd_get_title_string(m_ddvdconfig, m_ddvd_titlestring); eDebug("DDVD_SHOWOSD_TITLESTRING: %s",m_ddvd_titlestring); loadCuesheet(); + if (!m_cue_pts) + unpause(); m_event(this, evStart); break; } @@ -734,8 +736,6 @@ void eServiceDVD::loadCuesheet() m_event((iPlayableService*)this, evCuesheetChanged); eDebug("eServiceDVD::loadCuesheet() pts=%lld",m_cue_pts); } - else - unpause(); } void eServiceDVD::saveCuesheet() -- 2.30.2