Fix EncryptedVolumeDataSource EOF

This commit is contained in:
Matéo Duparc 2023-02-01 20:06:35 +01:00
parent d2f11c85d1
commit 5dbef99949
Signed by untrusted user: hardcoresushi
GPG Key ID: AFE384344A45E13A

View File

@ -50,7 +50,11 @@ class EncryptedVolumeDataSource(private val encryptedVolume: EncryptedVolume, pr
) {}
val totalRead = fileOffset-originalOffset
bytesRemaining -= totalRead
return totalRead.toInt()
return if (totalRead == 0L) {
C.RESULT_END_OF_INPUT
} else {
totalRead.toInt()
}
}
class Factory(private val encryptedVolume: EncryptedVolume, private val filePath: String): DataSource.Factory {