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.