diff --git a/client/tp-player/bar.cpp b/client/tp-player/bar.cpp index 32b4a23..ff034ff 100644 --- a/client/tp-player/bar.cpp +++ b/client/tp-player/bar.cpp @@ -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()); } } diff --git a/client/tp-player/thr_play.cpp b/client/tp-player/thr_play.cpp index 254e617..f1d4d22 100644 --- a/client/tp-player/thr_play.cpp +++ b/client/tp-player/thr_play.cpp @@ -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) {