Expose PCM drain state and cursor while file playback waits at EOF
This commit is contained in:
1 parent
d8109770a0
commit
7fe90be7b2
2 files changed
+9
No files matched your search
@@ -524,6 +524,14 @@ void VideoPlayerEngine::presentTick() {
|
||||
|
||||
const bool audioDone = !m_hasAudio || (!SoundManager::instance()->isPcmPlaying(m_audioPlayback) &&
|
||||
SoundManager::instance()->pcmCursor(m_audioPlayback) >= m_audioFrames);
|
||||
if (m_decodeEof && m_elapsed.elapsed() - m_drainReportAt >= 1000) {
|
||||
m_drainReportAt = m_elapsed.elapsed();
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_VIDEO,
|
||||
"VideoEngine: drain epoch=%d position=%lldms pending=%zu video_end=%lldms PCM=%llu/%llu playing=%d audio_clock=%d",
|
||||
epoch, (long long)clk, m_pending.size(), (long long)m_videoEndMs,
|
||||
(unsigned long long)SoundManager::instance()->pcmCursor(m_audioPlayback), (unsigned long long)m_audioFrames,
|
||||
SoundManager::instance()->isPcmPlaying(m_audioPlayback), m_audioClock);
|
||||
}
|
||||
if (m_decodeEof && m_pending.empty() && clk >= m_videoEndMs && audioDone) {
|
||||
m_presentTimer.stop();
|
||||
DEBUG_INFO(DEBUG_CATEGORY_VIDEO, "VideoEngine: playback finished epoch=%d position=%lldms video_end=%lldms audio_done=%d",
|
||||
|
||||
@@ -92,6 +92,7 @@ private:
|
||||
QImage m_renderFrame;
|
||||
bool m_decodeEof = false; // EOF только текущей эпохи; не меняет состояние/возможность паузы.
|
||||
qint64 m_videoEndMs = 0; // Максимальный конец принятого кадра: PTS + его длительность.
|
||||
qint64 m_drainReportAt = 0; // Последний DEBUG-снимок доигрывания по m_elapsed, мс; не чаще раза в секунду.
|
||||
QTimer m_presentTimer;
|
||||
uint64_t m_audioPlayback = 0;
|
||||
int m_audioSampleRate = 0;
|
||||
|
||||
Reference in new issue
Block a user