filebrowser now ends up in previous directory again after playing a dvd stucture...
[enigma2.git] / lib / python / Plugins / Extensions / DVDPlayer / src / servicedvd.cpp
index a756e75..da7bc5f 100644 (file)
@@ -115,6 +115,7 @@ eServiceDVD::eServiceDVD(const char *filename):
        CONNECT(m_pump.recv_msg, eServiceDVD::gotThreadMessage);
        strcpy(m_ddvd_titlestring,"");
        m_cue_pts = 0;
+       pause();
 }
 
 void eServiceDVD::gotThreadMessage(const int &msg)
@@ -230,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;
                }
@@ -739,21 +742,26 @@ void 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;
+               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' )