Index: osd.c
===================================================================
RCS file: /cvsroot/xineliboutput/vdr-xineliboutput/osd.c,v
retrieving revision 1.38
diff -u -r1.38 osd.c
--- osd.c	19 Aug 2009 17:15:37 -0000	1.38
+++ osd.c	1 Dec 2009 11:58:38 -0000
@@ -20,6 +20,10 @@
 
 #include "osd.h"
 
+#ifndef OSD_LEVEL_TTXTSUBS
+#define OSD_LEVEL_TTXTSUBS 20 // from ttxtsubs plugin
+#endif
+
 //#define LIMIT_OSD_REFRESH_RATE
 
 #define LOGOSD(x...)
@@ -366,11 +370,16 @@
 
 #if VDRVERSNUM >= 10708
 
-  double Aspect;
-  int    W, H;
-  m_Device->GetOsdSize(W, H, Aspect);
-  m_ExtentWidth  = W;
-  m_ExtentHeight = H;
+  if(xc.osd_scaling && ((m_Layer==OSD_LEVEL_SUBTITLES) || (m_Layer==OSD_LEVEL_TTXTSUBS))) {
+    m_ExtentWidth  = 720;
+    m_ExtentHeight = 576;
+  } else {
+    double Aspect;
+    int    W, H;
+    m_Device->GetOsdSize(W, H, Aspect);
+    m_ExtentWidth  = W;
+    m_ExtentHeight = H;
+  }
 
 #else
 
@@ -439,9 +448,16 @@
   if(!m_IsVisible)
     return;
 
-  int SendDone = 0;
+  int SendDone = 0, XOffset = 0, YOffset = 0;
+  if(!xc.osd_scaling && ((m_Layer==OSD_LEVEL_SUBTITLES) || (m_Layer==OSD_LEVEL_TTXTSUBS))) {
+    double Aspect;
+    int    W, H;
+    m_Device->GetOsdSize(W, H, Aspect);
+    XOffset = (H - 576) > 0 ? (H - 576) : 0;
+    YOffset = ((W - 720) / 2) ? ((W - 720) / 2) : 0;
+  }
   for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) {
-    int x1 = 0, y1 = 0, x2 = Bitmap->Width()-1, y2 = Bitmap->Height()-1;
+    int x1 = XOffset, y1 = YOffset, x2 = x1+Bitmap->Width()-1, y2 = y1+Bitmap->Height()-1;
     if (m_Refresh || Bitmap->Dirty(x1, y1, x2, y2)) {
 
       /* XXX what if only palette has been changed ? */
