enable dream keyboard
[enigma2.git] / lib / python / Plugins / Extensions / DVDPlayer / src / servicedvd.cpp
index 0a3d035912770a3b76634510932045b0a0d800b1..02c0ca940057d6794597d23a04b6040064f99d5d 100644 (file)
@@ -120,9 +120,9 @@ eServiceDVD::eServiceDVD(const char *filename):
        if (fd > -1)
        {
                rd = read(fd, tmp, 255);
-               if (rd > 6 && !strncmp(tmp, "bestfit", 3))
+               if (rd > 6 && !strncmp(tmp, "bestfit", 7))
                        aspect = DDVD_JUSTSCALE;
-               else if (rd > 8 && !strncmp(tmp, "letterbox", 5))
+               else if (rd > 8 && !strncmp(tmp, "letterbox", 9))
                        aspect = DDVD_LETTERBOX;
                close(fd);
        }
@@ -176,8 +176,11 @@ void eServiceDVD::gotMessage(int /*what*/)
                }
                case DDVD_SCREEN_UPDATE:
                        eDebug("DVD_SCREEN_UPDATE!");
-                       if (m_subtitle_widget)
-                               m_subtitle_widget->setPixmap(m_pixmap, eRect(ePoint(0, 0), m_pixmap->size()));
+                       if (m_subtitle_widget) {
+                               int x1,x2,y1,y2;
+                               ddvd_get_last_blit_area(m_ddvdconfig, &x1, &x2, &y1, &y2);
+                               m_subtitle_widget->setPixmap(m_pixmap, eRect(x1, y1, x2-x1, y2-y1));
+                       }
                        break;
                case DDVD_SHOWOSD_STATE_PLAY:
                {
@@ -277,6 +280,7 @@ eServiceDVD::~eServiceDVD()
        kill();
        saveCuesheet();
        ddvd_close(m_ddvdconfig);
+       disableSubtitles(0);
 }
 
 RESULT eServiceDVD::connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)
@@ -531,8 +535,7 @@ PyObject *eServiceDVD::getInfoObject(int w)
 
 RESULT eServiceDVD::enableSubtitles(eWidget *parent, SWIG_PYOBJECT(ePyObject) /*entry*/)
 {
-       if (m_subtitle_widget)
-               delete m_subtitle_widget;
+       delete m_subtitle_widget;
 
        m_subtitle_widget = new eSubtitleWidget(parent);
        m_subtitle_widget->resize(parent->size());