Skip to content

Commit

Permalink
Merge pull request wang-bin#933 from wangwenx190/master
Browse files Browse the repository at this point in the history
修复Player出现视频预览小窗后其解码所需的额外内存不会在其关闭后释放的问题
  • Loading branch information
wang-bin authored Jul 31, 2017
2 parents cda61b2 08f2f87 commit cf931f7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions examples/player/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,16 1325,26 @@ void MainWindow::onTimeSliderHover(int pos, int value)
m_preview->preview();
const int w = Config::instance().previewWidth();
const int h = Config::instance().previewHeight();
m_preview->setWindowFlags(m_preview->windowFlags() |Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
m_preview->setWindowFlags(Qt::Tool |Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
m_preview->resize(w, h);
m_preview->move(gpos - QPoint(w/2, h));
m_preview->show();
}

void MainWindow::onTimeSliderLeave()
{
if (m_preview && m_preview->isVisible())
m_preview->hide();
/*if (m_preview && m_preview->isVisible())
m_preview->hide();*/
if (!m_preview)
{
return;
}
if (m_preview->isVisible())
{
m_preview->close();
}
delete m_preview;
m_preview = NULL;
}

void MainWindow::handleError(const AVError &e)
Expand Down

0 comments on commit cf931f7

Please sign in to comment.