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

+5 -1
View File
@@ -196,7 +196,11 @@ private slots:
pcm[2 * i + 1] = static_cast<int16_t>(1500 * std::sin((sampleFrame + i) * 0.13));
}
sampleFrame += 960;
int length = opus_codec_encode(opus.get(), pcm, 960, encoded, sizeof(encoded)); QVERIFY(length > 0);
int length = opus_codec_encode(opus.get(), pcm, 960, encoded, sizeof(encoded));
if (length <= 0) {
DEBUG_ERROR(DEBUG_CATEGORY_STREAM, "desktop startup fixture Opus encode failed result=%d", length);
return QList<QByteArray>{};
}
packets.append(QByteArray(reinterpret_cast<const char*>(encoded), length));
}
return packets;