diff -r e80bfaa1cf1f src/core/android/SDL_android.cpp --- a/src/core/android/SDL_android.cpp vie oct 14 07:54:13 2011 -0300 +++ b/src/core/android/SDL_android.cpp vie oct 14 11:42:25 2011 -0300 @@ -522,13 +522,26 @@ if (movement > 0) { // The easy case where we're seeking forwards + void *buffer = malloc(1024); + long result; while (movement > 0) { + // skip shouldn't skip more bytes than requested, but under certain conditions + // it seems to be buggy, and from the documents it's implied that it reads bytes anyway, + // so we just read the bytes ourselves to avoid problems // inputStream.skip(...); - movement -= mEnv->CallLongMethod(inputStream, skipMethod, movement); + //movement -= mEnv->CallLongMethod(inputStream, skipMethod, movement); + if(movement > 1024) result = Android_JNI_FileRead(ctx, buffer, 1, 1024); + else result = Android_JNI_FileRead(ctx, buffer, 1, movement); + if (result == -1) { + newPosition += movement; + break; + } + movement -= result; if (Android_JNI_ExceptionOccurred()) { return -1; } } + free(buffer); } else if (movement < 0) { // We can't seek backwards so we have to reopen the file and seek // forwards which obviously isn't very efficient