Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[mp3][ogg] fixed error messages

  • Loading branch information...
commit 10cb7055281308858670224d46641da21be23c2b 1 parent 53eb0d2
@tulskiy authored
Showing with 4 additions and 2 deletions.
  1. +3 −1 jni/libmpg123/mpg123-jni.c
  2. +1 −1  jni/libtremolo/tremolo-jni.c
View
4 jni/libmpg123/mpg123-jni.c
@@ -55,8 +55,10 @@ void JNI_FUNCTION(seek) (JNIEnv* env, jobject obj, jint handle, jint offset) {
mpg123_handle* mh = (mpg123_handle*) handle;
int ret = mpg123_seek(mh, offset, SEEK_SET);
- if (ret != MPG123_OK) {
+ if (ret < 0) {
LOGE("Error during seek to sample %d: %s", offset, mpg123_plain_strerror(ret));
+ } else if (ret != offset) {
+ LOGE("mpg123_seek returned invalid offset, expected %d, got %d", offset, ret);
}
}
View
2  jni/libtremolo/tremolo-jni.c
@@ -58,7 +58,7 @@ jint JNI_FUNCTION(decode) (JNIEnv* env, jobject obj, jint handle, jbyteArray buf
(*env)->ReleaseByteArrayElements(env, buffer, target, 0);
if (ret <= 0) {
- LOGE("libvobis returned an error (possibly EOF): %s", ret);
+ if (ret != 0) LOGE("libvobis returned an error: %d", ret);
return -1;
} else {
return ret;
Please sign in to comment.
Something went wrong with that request. Please try again.