Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deadlock at the end of decoding. #3767

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions codec/decoder/plus/src/welsDecoderExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ void CWelsDecoder::OpenDecoderThreads() {
}
void CWelsDecoder::CloseDecoderThreads() {
if (m_iThreadCount >= 1) {
SET_EVENT (&m_sReleaseBufferEvent);
for (int32_t i = 0; i < m_iThreadCount; i++) { //waiting the completion begun slices
WAIT_SEMAPHORE (&m_pDecThrCtx[i].sThreadInfo.sIsIdle, WELS_DEC_THREAD_WAIT_INFINITE);
m_pDecThrCtx[i].sThreadInfo.uiCommand = WELS_DEC_THREAD_COMMAND_ABORT;
Expand Down Expand Up @@ -513,6 +514,8 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) {
if (pDecContext == NULL) return dsInitialOptExpected;

pDecContext->bEndOfStreamFlag = iVal ? true : false;
if (iVal && m_iThreadCount >= 1)
SET_EVENT (&m_sReleaseBufferEvent);

return cmResultSuccess;
} else if (eOptID == DECODER_OPTION_ERROR_CON_IDC) { // Indicate error concealment status
Expand Down
Loading