Fix audio support on Android (non-legacy)
This commit is contained in:
@@ -14,6 +14,7 @@ namespace lime {
|
|||||||
FILE_HANDLE (void* handle) : handle (handle) {}
|
FILE_HANDLE (void* handle) : handle (handle) {}
|
||||||
|
|
||||||
FILE* getFile ();
|
FILE* getFile ();
|
||||||
|
int getLength ();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ namespace lime {
|
|||||||
//#ifdef ANDROID
|
//#ifdef ANDROID
|
||||||
//ov_open (file, &oggFile, NULL, info.length);
|
//ov_open (file, &oggFile, NULL, info.length);
|
||||||
//#else
|
//#else
|
||||||
ov_open (file->getFile (), &oggFile, NULL, 0);
|
ov_open (file->getFile (), &oggFile, NULL, file->getLength ());
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -16,6 +16,14 @@ namespace lime {
|
|||||||
|
|
||||||
return ((SDL_RWops*)handle)->hidden.stdio.fp;
|
return ((SDL_RWops*)handle)->hidden.stdio.fp;
|
||||||
|
|
||||||
|
} else if (((SDL_RWops*)handle)->type == SDL_RWOPS_JNIFILE) {
|
||||||
|
|
||||||
|
#ifdef ANDROID
|
||||||
|
FILE* file = ::fdopen (((SDL_RWops*)handle)->hidden.androidio.fd, "rb");
|
||||||
|
::fseek (file, ((SDL_RWops*)handle)->hidden.androidio.offset, 0);
|
||||||
|
return file;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -23,6 +31,13 @@ namespace lime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int FILE_HANDLE::getLength () {
|
||||||
|
|
||||||
|
return SDL_RWsize (((SDL_RWops*)handle));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int fclose (FILE_HANDLE *stream) {
|
int fclose (FILE_HANDLE *stream) {
|
||||||
|
|
||||||
if (stream) {
|
if (stream) {
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ namespace lime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int FILE_HANDLE::getLength () {
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int fclose (FILE_HANDLE *stream) {
|
int fclose (FILE_HANDLE *stream) {
|
||||||
|
|
||||||
if (stream) {
|
if (stream) {
|
||||||
|
|||||||
@@ -215,7 +215,12 @@ class AndroidHelper {
|
|||||||
if (deviceID == null) {
|
if (deviceID == null) {
|
||||||
|
|
||||||
Sys.sleep (3);
|
Sys.sleep (3);
|
||||||
Sys.print (".");
|
|
||||||
|
if (!LogHelper.verbose) {
|
||||||
|
|
||||||
|
Sys.print (".");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user