Clean desktop stream lifecycle and event bridge logging
This commit is contained in:
1 parent
b40ba9308f
commit
044a20d4a0
3 files changed
+13
-26
No files matched your search
@@ -305,7 +305,7 @@ void StreamPlayerWindow::decode() {
|
||||
{ std::lock_guard<std::mutex> guard(p.lock); resync = p.resync; p.workerAt = nowUs(); gap = p.audioGap; }
|
||||
/* Callback сохраняет снимок; печать выполняется worker без блокировки аудиоустройства. */
|
||||
if (gap.count != reportedGaps && nowUs() - gapReportAt >= 1000000) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_DEBUG,
|
||||
DEBUG_WARN(DEBUG_CATEGORY_STREAM,
|
||||
"desktop audio gap id=%llu count=%llu delta=%llu silence_frames=%llu cause=%s got=%u/%u "
|
||||
"reserve_us=%lld feed_age_us=%lld worker_age_us=%lld audio_pts=%lld videoQ=%zu",
|
||||
(unsigned long long)p.id, (unsigned long long)gap.count, (unsigned long long)(gap.count - reportedGaps),
|
||||
@@ -388,15 +388,11 @@ void StreamPlayerWindow::decode() {
|
||||
observe();
|
||||
if (record.pts > INT64_MAX) { fail(text("Invalid stream timestamp")); break; }
|
||||
if (record.kind == StreamRecordKind::Audio) {
|
||||
int result = 0, wanted = 0, stillWanted = 0;
|
||||
int result = 0;
|
||||
{ std::lock_guard<std::mutex> guard(p.lock);
|
||||
if (p.sound) wanted = stream_playback_audio_needs_input(p.sound);
|
||||
if (p.sound) result = stream_playback_audio_feed(p.sound, (int64_t)record.pts,
|
||||
reinterpret_cast<const uint8_t*>(record.data.constData()), (size_t)record.data.size());
|
||||
if (p.sound && result == 0) { p.audioFedAt = nowUs(); p.audioFedPts = (int64_t)record.pts; }
|
||||
if (p.sound) stillWanted = stream_playback_audio_needs_input(p.sound); }
|
||||
DEBUG_TRACE(DEBUG_CATEGORY_DEBUG, "desktop audio feed id=%llu pts=%llu result=%d needs_input=%d->%d",
|
||||
(unsigned long long)p.id, (unsigned long long)record.pts, result, wanted, stillWanted);
|
||||
if (p.sound && result == 0) { p.audioFedAt = nowUs(); p.audioFedPts = (int64_t)record.pts; } }
|
||||
if (result == -2) reset(true);
|
||||
else if (result < 0) { fail(text("Stream audio decoder failed")); break; }
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user