File: vdr-1.3.23-dvbspu.c.diff

package info (click to toggle)
vdr-plugin-dvd 0.3.6~b03%2Bcvs20090426.0013-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 480 kB
  • ctags: 619
  • sloc: ansic: 4,866; sh: 624; makefile: 89
file content (73 lines) | stat: -rw-r--r-- 2,242 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
diff -bur vdr-1.3.23_orig/dvbspu.c vdr-1.3.23/dvbspu.c
--- vdr-1.3.23_orig/dvbspu.c	2005-04-03 18:19:40.000000000 +0200
+++ vdr-1.3.23/dvbspu.c	2005-04-09 01:27:24.000000000 +0200
@@ -143,6 +143,8 @@
     if (ret)
         DEBUG("MinSize: (%d, %d) x (%d, %d)\n",
               size.x1, size.y1, size.x2, size.y2);
+    if (size.x1 > size.x2 || size.y1 > size.y2)
+       return false;
 
     return ret;
 }
@@ -304,24 +306,6 @@
     hlpsize.y2 = -1;
 }
 
-int cDvbSpuDecoder::ScaleYcoord(int value)
-{
-    if (scaleMode == eSpuLetterBox) {
-        int offset = cDevice::PrimaryDevice()->GetVideoSystem() == vsPAL ? 72 : 60;
-        return lround((value * 3.0) / 4.0) + offset;
-        }
-    else
-        return value;
-}
-
-int cDvbSpuDecoder::ScaleYres(int value)
-{
-    if (scaleMode == eSpuLetterBox)
-        return lround((value * 3.0) / 4.0);
-    else
-        return value;
-}
-
 sDvbSpuRect cDvbSpuDecoder::CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDvbSpuRect bgsize, cBitmap *bgbmp)
 {
     sDvbSpuRect size;
@@ -365,21 +349,15 @@
     sDvbSpuRect hlsize;
 
     hlsize.x1 = hlpsize.x1;
-    hlsize.y1 = ScaleYcoord(hlpsize.y1);
+    hlsize.y1 = hlpsize.y1;
     hlsize.x2 = hlpsize.x2;
-    hlsize.y2 = ScaleYcoord(hlpsize.y2);
+    hlsize.y2 = hlpsize.y2;
 
     if (highlight)
         fg = spubmp->getBitmap(hlpDescr, palette, hlsize);
 
     if (spubmp->getMinSize(palDescr, bgsize)) {
         bg = spubmp->getBitmap(palDescr, palette, bgsize);
-        if (scaleMode == eSpuLetterBox) {
-            // the coordinates have to be modified for letterbox
-            int y1 = ScaleYres(bgsize.y1) + bgsize.height();
-            bgsize.y2 = y1 + bgsize.height();
-            bgsize.y1 = y1;
-        }
     }
 
     sDvbSpuRect areaSize = CalcAreaSize(hlsize, fg, bgsize, bg);
diff -bur vdr-1.3.23_orig/dvbspu.h vdr-1.3.23/dvbspu.h
--- vdr-1.3.23_orig/dvbspu.h	2005-04-03 18:19:40.000000000 +0200
+++ vdr-1.3.23/dvbspu.h	2005-04-09 01:27:33.000000000 +0200
@@ -129,8 +129,6 @@
         return ((spu[0] << 8) | spu[1]);
     };
 
-    int ScaleYcoord(int value);
-    int ScaleYres(int value);
     sDvbSpuRect CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDvbSpuRect bgsize, cBitmap *bgbmp);
 
   public: