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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
Index: libs/libmythtv/NuppelVideoPlayer.cpp
===================================================================
--- libs/libmythtv/NuppelVideoPlayer.cpp (revision 13535)
+++ libs/libmythtv/NuppelVideoPlayer.cpp (working copy)
@@ -1475,6 +1475,12 @@
}
}
+void NuppelVideoPlayer::DrawUnusedRects(bool sync)
+{
+ if (videoOutput)
+ videoOutput->DrawUnusedRects(sync);
+}
+
void NuppelVideoPlayer::ResetCaptions(uint mode_override)
{
uint origMode = textDisplayMode;
Index: libs/libmythtv/guidegrid.h
===================================================================
--- libs/libmythtv/guidegrid.h (revision 13535)
+++ libs/libmythtv/guidegrid.h (working copy)
@@ -86,8 +86,9 @@
void paintEvent(QPaintEvent *);
private slots:
- void timeout();
- void jumpToChannelTimeout();
+ void timeCheckTimeout(void);
+ void repaintVideoTimeout(void);
+ void jumpToChannelTimeout(void);
private:
void keyPressEvent(QKeyEvent *e);
@@ -174,6 +175,7 @@
QString currentTimeColor;
QTimer *timeCheck;
+ QTimer *videoRepaintTimer;
bool keyDown;
Index: libs/libmythtv/tv_play.h
===================================================================
--- libs/libmythtv/tv_play.h (revision 13535)
+++ libs/libmythtv/tv_play.h (working copy)
@@ -112,6 +112,7 @@
void StopEmbeddingOutput(void);
bool IsEmbedding(void);
void EPGChannelUpdate(uint chanid, QString channum);
+ void DrawUnusedRects(bool sync);
// Recording commands
int PlayFromRecorder(int recordernum);
Index: libs/libmythtv/guidegrid.cpp
===================================================================
--- libs/libmythtv/guidegrid.cpp (revision 13535)
+++ libs/libmythtv/guidegrid.cpp (working copy)
@@ -261,9 +261,14 @@
timeCheck = NULL;
timeCheck = new QTimer(this);
- connect(timeCheck, SIGNAL(timeout()), SLOT(timeout()) );
+ connect(timeCheck, SIGNAL(timeout()), SLOT(timeCheckTimeout()) );
timeCheck->start(200);
+ videoRepaintTimer = new QTimer(this);
+ QObject::connect(videoRepaintTimer, SIGNAL(timeout()),
+ this, SLOT(repaintVideoTimeout()));
+ videoRepaintTimer->start(1000);
+
selectState = false;
updateBackground();
@@ -281,18 +286,46 @@
for (int x = 0; x < MAX_DISPLAY_TIMES; x++)
{
if (m_timeInfos[x])
+ {
delete m_timeInfos[x];
+ m_timeInfos[x] = NULL;
+ }
}
for (int y = 0; y < MAX_DISPLAY_CHANS; y++)
{
if (m_programs[y])
+ {
delete m_programs[y];
+ m_programs[y] = NULL;
+ }
}
m_channelInfos.clear();
- delete theme;
+ if (theme)
+ {
+ delete theme;
+ theme = NULL;
+ }
+
+ if (jumpToChannelTimer)
+ {
+ jumpToChannelTimer->deleteLater();
+ jumpToChannelTimer = NULL;
+ }
+
+ if (timeCheck)
+ {
+ timeCheck->deleteLater();
+ timeCheck = NULL;
+ }
+
+ if (videoRepaintTimer)
+ {
+ videoRepaintTimer->deleteLater();
+ videoRepaintTimer = NULL;
+ }
}
void GuideGrid::keyPressEvent(QKeyEvent *e)
@@ -533,7 +566,7 @@
return m_channelInfos[idx].chanid;
}
-void GuideGrid::timeout()
+void GuideGrid::timeCheckTimeout(void)
{
timeCheck->changeInterval((int)(60 * 1000));
QTime new_time = QTime::currentTime();
@@ -561,6 +594,12 @@
repaint(curInfoRect, false);
}
+void GuideGrid::repaintVideoTimeout(void)
+{
+ timeCheck->changeInterval(1000);
+ update(videoRect);
+}
+
void GuideGrid::fillChannelInfos(bool gotostartchannel)
{
m_channelInfos.clear();
@@ -974,6 +1013,7 @@
if (r.intersects(videoRect) && m_player)
{
timeCheck->changeInterval((int)(200));
+ m_player->DrawUnusedRects(false);
}
qApp->unlock();
@@ -1794,7 +1834,10 @@
ChannelInfo info = m_channelInfos[idx];
if (m_player)
+ {
m_player->EPGChannelUpdate(info.chanid, info.chanstr);
+ videoRepaintTimer->start(200);
+ }
}
//
Index: libs/libmythtv/NuppelVideoPlayer.h
===================================================================
--- libs/libmythtv/NuppelVideoPlayer.h (revision 13535)
+++ libs/libmythtv/NuppelVideoPlayer.h (working copy)
@@ -118,6 +118,7 @@
void StopEmbedding(void);
void ExposeEvent(void);
bool IsEmbedding(void);
+ void DrawUnusedRects(bool sync);
// Audio Sets
void SetNoAudio(void) { no_audio_out = true; }
Index: libs/libmythtv/tv_play.cpp
===================================================================
--- libs/libmythtv/tv_play.cpp (revision 13535)
+++ libs/libmythtv/tv_play.cpp (working copy)
@@ -5035,6 +5035,12 @@
return false;
}
+void TV::DrawUnusedRects(bool sync)
+{
+ if (nvp)
+ nvp->DrawUnusedRects(sync);
+}
+
void TV::doEditSchedule(int editType)
{
if (!playbackinfo)
Index: libs/libmythtv/videoout_xv.cpp
===================================================================
--- libs/libmythtv/videoout_xv.cpp (revision 13535)
+++ libs/libmythtv/videoout_xv.cpp (working copy)
@@ -2465,7 +2465,7 @@
}
if ((needrepaint || xv_need_bobdeint_repaint) &&
- (VideoOutputSubType() >= XVideo))
+ (VideoOutputSubType() >= XVideo) && !embedding)
{
DrawUnusedRects(/* don't do a sync*/false);
}
@@ -2480,12 +2480,6 @@
void VideoOutputXv::DrawUnusedRects(bool sync)
{
- // Unfortunately, this gets drawn in the wrong place on prebuffering
- // pauses when embedding and this is rarely useful when embedding
- // since the background is drawn in guidegrid so we bail here. -- dtk
- if (embedding)
- return;
-
// boboff assumes the smallest interlaced resolution is 480 lines - 5%
bool use_bob = (m_deinterlacing && m_deintfiltername == "bobdeint");
int boboff_raw = (int)round(((double)display_video_rect.height()) /
@@ -2512,7 +2506,12 @@
X11L;
- if (xv_draw_colorkey && needrepaint)
+ // This is used to avoid drawing the colorkey when embedding and
+ // not using overlay. This is needed because we don't paint this
+ // in the vertical retrace period when calling this from the EPG.
+ bool clrdraw = xv_colorkey || !embedding;
+
+ if (xv_draw_colorkey && needrepaint && clrdraw)
{
XSetForeground(XJ_disp, XJ_gc, xv_colorkey);
XFillRectangle(XJ_disp, XJ_curwin, XJ_gc,
@@ -2521,7 +2520,7 @@
display_visible_rect.width(),
display_visible_rect.height() - 2 * boboff);
}
- else if (xv_draw_colorkey && xv_need_bobdeint_repaint)
+ else if (xv_draw_colorkey && xv_need_bobdeint_repaint && clrdraw)
{
// if this is only for deinterlacing mode switching, draw
// the border areas, presumably the main image is undamaged.
|