Skip to content

Commit

Permalink
DVD: Fix dvd button positioning.
Browse files Browse the repository at this point in the history
Refs #9860

Signed-off-by: Mark Kendall <mkendall@mythtv.org>
  • Loading branch information
martin authored and Mark Kendall committed Jun 23, 2011
1 parent 2f52fae commit 801aebf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
15 changes: 3 additions & 12 deletions mythtv/libs/libmythtv/dvdringbuffer.cpp
Expand Up @@ -1245,9 +1245,7 @@ AVSubtitle *DVDRingBuffer::GetMenuSubtitle(uint &version)
// this is unlocked by ReleaseMenuButton
m_menuBtnLock.lock();

if ((m_menuBuflength > 4) && m_buttonExists && (NumMenuButtons() > 0) &&
(m_dvdMenuButton.rects[0]->h >= m_hl_button.height()) &&
(m_dvdMenuButton.rects[0]->w >= m_hl_button.width()))
if ((m_menuBuflength > 4) && m_buttonExists && (NumMenuButtons() > 0))
{
version = m_buttonVersion;
return &(m_dvdMenuButton);
Expand All @@ -1270,15 +1268,8 @@ QRect DVDRingBuffer::GetButtonCoords(void)
if (!m_buttonExists)
return rect;

int x1, y1;
int x = 0; int y = 0;
x1 = m_dvdMenuButton.rects[0]->x;
y1 = m_dvdMenuButton.rects[0]->y;
if (m_hl_button.x() > x1)
x = m_hl_button.x() - x1;
if (m_hl_button.y() > y1)
y = m_hl_button.y() - y1;
rect.setRect(x, y, m_hl_button.width(), m_hl_button.height());
rect.setRect(m_hl_button.x(), m_hl_button.y(), m_hl_button.width(),
m_hl_button.height());

return rect;
}
Expand Down
7 changes: 4 additions & 3 deletions mythtv/libs/libmythtv/subtitlescreen.cpp
Expand Up @@ -560,7 +560,9 @@ void SubtitleScreen::DisplayDVDButton(AVSubtitle* dvdButton, QRect &buttonPos)
VERBOSE(VB_PLAYBACK, LOC + "Added DVD button background");
}

QImage fg_image = bg_image.copy(buttonPos);
// copy button region of background image
QRect fg_rect(buttonPos.translated(-hl_button->x, -hl_button->y));
QImage fg_image = bg_image.copy(fg_rect);
QVector<unsigned int> fg_palette;
uint32_t *fgpalette = (uint32_t *)(dvdButton->rects[1]->pict.data[1]);
if (fgpalette)
Expand All @@ -571,9 +573,8 @@ void SubtitleScreen::DisplayDVDButton(AVSubtitle* dvdButton, QRect &buttonPos)
}

// scale highlight image to match OSD size, if required
QRect button = buttonPos.adjusted(0, 2, 0, 0);
fg_image = fg_image.convertToFormat(QImage::Format_ARGB32);
AddScaledImage(fg_image, button);
AddScaledImage(fg_image, buttonPos);
}

void SubtitleScreen::DisplayCC608Subtitles(void)
Expand Down

0 comments on commit 801aebf

Please sign in to comment.