After some more debugging, I discovered the root cause of the problem.
The issue was caused by inconsistent buffer sizes across different parts of the code.
Once I unified/standardized the buffer size to the same value everywhere, everything started working correctly.
Topic:
Media Technologies
SubTopic:
Streaming
Tags: