Re: xineliboutput vdpau crop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 3 Jan 2010, Mika Laitio wrote:

If I watch vdr-sxfe just from a small window, the subtitle and text are positioned correctly with a good looking font size to bottom of the screen. But if I watch finish "yle 1" channel which uses dvb subtitles from fullscreen vdr-sxfe, the subtitle font is small and text is positioned about to middle of the screen. (Left position is correct)

Have you tried to change the subtitles decoder from VDR to xine?

Anyway, the problem is that the resolution and position information of subtitles is 720x576. If your output resolution differs from that, the subtitles are misplaced. The attached patch might help you as it should scale the subtitles osd always to 720x576 (found it on my hd and it comes with "perävalotakuu" :) when using VDR's subtitles decoders.

BR,
--
rofa
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 ? */
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux