src/core/android/SDL_android.cpp
changeset 6816 b3d3ef1e15b5
parent 6806 9e57ff36fd7a
child 6828 ac7f004fb63c
--- a/src/core/android/SDL_android.cpp	Mon Jan 14 08:14:53 2013 -0800
+++ b/src/core/android/SDL_android.cpp	Mon Jan 14 20:20:33 2013 -0300
@@ -613,6 +613,9 @@
     descriptor = mEnv->GetFieldID(fdCls, "descriptor", "I");
     ctx->hidden.androidio.fd = mEnv->GetIntField(fd, descriptor);
 
+    // Seek to the correct offset in the file.
+    lseek(ctx->hidden.androidio.fd, (off_t)ctx->hidden.androidio.offset, SEEK_SET);
+
     if (false) {
 fallback:
         __android_log_print(ANDROID_LOG_DEBUG, "SDL", "Falling back to legacy InputStream method for opening file");