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

Conversation

tyan0
Copy link
Contributor

@tyan0 tyan0 commented Jul 12, 2024

Issue

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).

To reproduce

  • Apply the following patch to h264dec and build it to enable multi-thread decoding.
diff --git a/codec/console/dec/src/h264dec.cpp b/codec/console/dec/src/h264dec.cpp
index 78c5c5d0..4851062f 100644
--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -622,7 +622,7 @@ int32_t main (int32_t iArgC, char* pArgV[]) {
     pDecoder->SetOption (DECODER_OPTION_TRACE_LEVEL, &iLevelSetting);
   }

-  int32_t iThreadCount = 0;
+  int32_t iThreadCount = 3;
   pDecoder->SetOption (DECODER_OPTION_NUM_OF_THREADS, &iThreadCount);

   if (pDecoder->Initialize (&sDecParam)) {

@tyan0 tyan0 force-pushed the bug_fix_6 branch 2 times, most recently from 97ea967 to ab732c2 Compare July 14, 2024 07:27
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) and CloseDecoderThreads().
@BenzhengZhang BenzhengZhang merged commit e0bbb7f into cisco:master Jul 18, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants