Drain startup audio on END and validate Opus fixture failures

This commit is contained in:
evgeny committed 2026-10-13 16:27:12 +02:00
1 parent f42b085e12
commit 79701feef1
2 files changed
+11 -3

No files matched your search

+6 -2
View File
@@ -186,7 +186,7 @@ void StreamPlayerWindow::decode() {
uint32_t videoRevision = 0;
auto reset = [&] {
avcodec_free_context(&decoder);
opus_codec_decoder_destroy(opus); opus = nullptr; expectedAudio = -1; waitKey = true;
opus_codec_decoder_destroy(opus); opus = nullptr; expectedAudio = -1; waitKey = true; prerollSamples = 0;
std::lock_guard<std::mutex> guard(p.lock);
p.videos.clear(); p.videoBytes = 0; p.audios.clear(); p.prefillUntil = 0; p.videoBase = p.audioPts = -1;
emit statusChanged(text("Waiting for a key frame…"));
@@ -213,7 +213,11 @@ void StreamPlayerWindow::decode() {
: record.reason == STREAM_CLOSE_GROUP ? "The channel is closed" : "Could not continue the stream";
fail(text(reason)); break;
}
if (record.kind == StreamRecordKind::End) { std::lock_guard<std::mutex> guard(p.lock); p.ended = true; break; }
if (record.kind == StreamRecordKind::End) {
std::lock_guard<std::mutex> guard(p.lock); p.ended = true;
if (p.videoBase < 0) p.audios.clear();
break;
}
if (record.pts > INT64_MAX) { fail(text("Invalid stream timestamp")); break; }
if (record.kind == StreamRecordKind::Audio) {
if (!p.audioAvailable) continue;