pull/175/head^2
Apex Liu 2019-11-06 03:15:23 +08:00
parent bde794d253
commit 2d5c9eeae0
2 changed files with 9 additions and 2 deletions

View File

@ -470,6 +470,8 @@ void Bar::onMousePress(int x, int y, Qt::MouseButton button) {
// TODO: 暂停播放,按比例计算出点击位置占整个录像时长的百分比,定位到此位置准备播放。
// TODO: 如果点击的位置是进度条指示标志,则仅暂停播放
m_owner->pause();
m_playing = false;
m_owner->update(m_rc.left()+m_rc_btn_play.left(), m_rc.top()+m_rc_btn_play.top(), m_rc_btn_play.width(), m_rc_btn_play.height());
}
}
@ -481,6 +483,8 @@ void Bar::onMouseRelease(int x, int y, Qt::MouseButton button) {
m_progress_pressed = false;
qDebug("resume at %dms.", m_resume_ms);
m_owner->resume(true, m_resume_ms);
m_playing = true;
m_owner->update(m_rc.left()+m_rc_btn_play.left(), m_rc.top()+m_rc_btn_play.top(), m_rc_btn_play.width(), m_rc_btn_play.height());
}
}

View File

@ -109,7 +109,10 @@ void ThrPlay::run() {
uint32_t this_time_ms = dat->get_time();
uint32_t this_pass_ms = last_time_ms;
if(this_time_ms > 0) {
need_wait_ms = this_time_ms - last_time_ms;
if(this_time_ms >= last_time_ms)
need_wait_ms = this_time_ms - last_time_ms;
else
need_wait_ms = 0;
if(need_wait_ms > 0) {
uint32_t time_wait = 0;
@ -177,8 +180,8 @@ void ThrPlay::run() {
// }
}
last_time_ms = this_time_ms;
}
last_time_ms = this_time_ms;
// 3. 将数据包发送给主UI界面进行显示
if(dat->data_type() == TYPE_END) {