Skip to content
Snippets Groups Projects
Commit 4505c8f5 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

VideoReceiveThread: end loop on end of file

The loop can be restarted if needed.
This avoids a buzy loop after end of file.

Change-Id: I13736712f72ce79cb81e9fd169f80b1851709957
parent db095d26
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ VideoReceiveThread::VideoReceiveThread(const std::string& id,
VideoReceiveThread::~VideoReceiveThread()
{
loop_.join();
JAMI_DBG("[%p] Instance destroyed", this);
}
......@@ -212,17 +213,21 @@ VideoReceiveThread::decodeFrame()
if (not isVideoConfigured_) {
if (!configureVideoOutput()) {
JAMI_ERR("[%p] Failed to configure video output", this);
JAMI_ERROR("[{:p}] Failed to configure video output", fmt::ptr(this));
return;
} else {
JAMI_DBG("[%p] Decoder configured, starting decoding", this);
JAMI_LOG("[{:p}] Decoder configured, starting decoding", fmt::ptr(this));
}
}
auto status = videoDecoder_->decode();
if (status == MediaDemuxer::Status::EndOfFile || status == MediaDemuxer::Status::ReadError) {
JAMI_ERR("[%p] Decoding error: %s", this, MediaDemuxer::getStatusStr(status));
if (status == MediaDemuxer::Status::EndOfFile) {
JAMI_LOG("[{:p}] End of file", fmt::ptr(this));
loop_.stop();
}
else if (status == MediaDemuxer::Status::ReadError) {
JAMI_ERROR("[{:p}] Decoding error: %s", fmt::ptr(this), MediaDemuxer::getStatusStr(status));
}
if (status == MediaDemuxer::Status::FallBack) {
else if (status == MediaDemuxer::Status::FallBack) {
if (keyFrameRequestCallback_)
keyFrameRequestCallback_();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment