|
|
|
|
@ -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; |
|
|
|
|
|