Skip to content

Commit 7cbf77c

Browse files
author
Isaac
committed
Return EOF when fetchedCount == 0
1 parent 3bd97fc commit 7cbf77c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

submodules/MediaPlayer/Sources/FFMpegMediaFrameSourceContext.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ private func readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: Unsa
184184
}
185185
fetchedCount = Int32(fetchedData.count)
186186
context.readingOffset += Int64(fetchedCount)
187+
188+
if fetchedCount == 0 {
189+
return FFMPEG_CONSTANT_AVERROR_EOF
190+
}
187191
}
188192

189193
if context.closed {

submodules/MediaPlayer/Sources/UniversalSoftwareVideoSource.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ private func readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: Unsa
7070
}
7171
let fetchedCount = Int32(fetchedData.count)
7272
context.readingOffset += Int64(fetchedCount)
73+
if fetchedCount == 0 {
74+
return FFMPEG_CONSTANT_AVERROR_EOF
75+
}
7376
return fetchedCount
7477
} else {
7578
return FFMPEG_CONSTANT_AVERROR_EOF

0 commit comments

Comments
 (0)