Skip to content

Commit

Permalink
Return EOF when fetchedCount == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac committed Dec 24, 2024
1 parent 3bd97fc commit 7cbf77c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ private func readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: Unsa
}
fetchedCount = Int32(fetchedData.count)
context.readingOffset += Int64(fetchedCount)

if fetchedCount == 0 {
return FFMPEG_CONSTANT_AVERROR_EOF
}
}

if context.closed {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ private func readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: Unsa
}
let fetchedCount = Int32(fetchedData.count)
context.readingOffset += Int64(fetchedCount)
if fetchedCount == 0 {
return FFMPEG_CONSTANT_AVERROR_EOF
}
return fetchedCount
} else {
return FFMPEG_CONSTANT_AVERROR_EOF
Expand Down

0 comments on commit 7cbf77c

Please sign in to comment.