X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/1d8153e23d1cd08c83a784a5b3a00cb4b6ee33f1..b643641e2c6288eff61d0346a3dda82bd820b3b7:/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp index cf26f35d..0372c497 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp +++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp @@ -51,7 +51,7 @@ DEFINE_REF(eServiceFactoryDVD) RESULT eServiceFactoryDVD::play(const eServiceReference &ref, ePtr &ptr) { // check resources... - ptr = new eServiceDVD(ref.path.c_str()); + ptr = new eServiceDVD(ref); return 0; } @@ -84,16 +84,17 @@ RESULT eServiceFactoryDVD::offlineOperations(const eServiceReference &, ePtr -1) + { + rd = read(fd, tmp, 255); + if (rd > 6 && !strncmp(tmp, "bestfit", 7)) + policy2 = DDVD_JUSTSCALE; + else if (rd > 8 && !strncmp(tmp, "letterbox", 9)) + policy2 = DDVD_LETTERBOX; + close(fd); + } + ddvd_set_video_ex(m_ddvdconfig, aspect, policy, policy2, DDVD_PAL /*unused*/); +#else ddvd_set_video(m_ddvdconfig, aspect, policy, DDVD_PAL /*unused*/); +#warning please update libdreamdvd for 16:10 scaling support! +#endif CONNECT(m_sn->activated, eServiceDVD::gotMessage); CONNECT(m_pump.recv_msg, eServiceDVD::gotThreadMessage); @@ -188,6 +204,7 @@ void eServiceDVD::gotMessage(int /*what*/) #ifdef DDVD_SUPPORTS_GET_BLIT_DESTINATION ddvd_get_blit_destination(m_ddvdconfig, &x_offset, &y_offset, &width, &height); eDebug("values got from ddvd: %d %d %d %d", x_offset, y_offset, width, height); + y_offset = -y_offset; width -= x_offset * 2; height -= y_offset * 2; #endif @@ -326,7 +343,7 @@ RESULT eServiceDVD::stop() ASSERT(m_state != stIdle); if (m_state == stStopped) return -1; - eDebug("DVD: stop %s", m_filename.c_str()); + eDebug("DVD: stop %s", m_ref.path.c_str()); m_state = stStopped; ddvd_send_key(m_ddvdconfig, DDVD_KEY_EXIT); @@ -440,7 +457,7 @@ RESULT eServiceDVD::getName(std::string &name) if ( m_ddvd_titlestring[0] != '\0' ) name = m_ddvd_titlestring; else - name = m_filename; + name = m_ref.path; return 0; } @@ -493,7 +510,7 @@ std::string eServiceDVD::getInfoString(int w) switch(w) { case sServiceref: - break; + return m_ref.toString(); default: eDebug("unhandled getInfoString(%d)", w); } @@ -679,7 +696,7 @@ RESULT eServiceDVD::setTrickmode(int /*trick*/) RESULT eServiceDVD::isCurrentlySeekable() { - return m_state == stRunning; + return m_state == stRunning ? 3 : 0; } RESULT eServiceDVD::keyPressed(int key) @@ -769,7 +786,7 @@ void eServiceDVD::loadCuesheet() if ( m_ddvd_titlestring[0] != '\0' ) snprintf(filename, 128, "/home/root/dvd-%s.cuts", m_ddvd_titlestring); else - snprintf(filename, 128, "%s/dvd.cuts", m_filename.c_str()); + snprintf(filename, 128, "%s/dvd.cuts", m_ref.path.c_str()); eDebug("eServiceDVD::loadCuesheet() filename=%s",filename); @@ -840,7 +857,7 @@ void eServiceDVD::saveCuesheet() if ( m_ddvd_titlestring[0] != '\0' ) snprintf(filename, 128, "/home/root/dvd-%s.cuts", m_ddvd_titlestring); else - snprintf(filename, 128, "%s/dvd.cuts", m_filename.c_str()); + snprintf(filename, 128, "%s/dvd.cuts", m_ref.path.c_str()); FILE *f = fopen(filename, "wb");