Skip to content

Commit

Permalink
Fix deadlock at the end of decoding.
Browse files Browse the repository at this point in the history
For some h264 files, h264dec hangs at the end of decoding. This is
regression caused by the commit 1c23887. This patch fixes the
issue by adding SET_EVENT(&m_sReleaseBufferEvent) to SetOption(
DECODER_OPTION_END_OF_STREAM).
  • Loading branch information
tyan0 committed Jul 14, 2024
1 parent 478e5ab commit ab732c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions codec/decoder/plus/src/welsDecoderExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,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

0 comments on commit ab732c2

Please sign in to comment.