When FFmpeg doesn't know from file metadata where a stream ends (e.g., MPEG transport streams), it tries to read until it reaches the end. To detect the end, it looks for a specific EOF code. Update the read function to return the EOF code instead of 0 (bytes read) and prevent FFmpeg from endlessly retrying to read.
When FFmpeg doesn't know from file metadata where a stream ends (e.g., MPEG transport streams), it tries to read until it reaches the end. To detect the end, it looks for a specific
EOF
code. Update theread
function to return theEOF
code instead of0
(bytes read) and prevent FFmpeg from endlessly retrying to read.