E/MediaPlayer(5346): error (-19, 0)
ググったらそれらしいのにはたどり着いたけど、直接的な原因が分からない。
ログを追っていたら、発生タイミングはほぼ同じで
リソース漏れしてる時こんな感じになるよなーとドキュメント読みなおしてたら
MediaPlayer削除するときに MediaPlayer.release() 呼んでなかった。
いと恥ずかしいです。
E/MediaPlayer(5346): error (-19, 0)
// ファイル名オブジェクト生成
jstring js = charToJstring(env, pFileName); // const char* -> jstring
// 受取り用バッファオブジェクト生成
jbyteArray ba = env->NewByteArray(buffSize);
jbyte* pArray = NULL;
if (js && ba)
{
// クラスを取得
jclass classObj = env->FindClass( "FromC" );
jmethodID method = env->GetStaticMethodID(classObj, "loadFile", "(Ljava/lang/String;[B)Z");
do {
if (method == NULL) {
LOGE( "method null" );
break;
}
bool result = env->CallStaticBooleanMethod(classObj, method, js, ba);
if (result == false) {
LOGE( "failed loadFile" );
break;
}
jboolean isCopy = JNI_FALSE;
pArray = env->GetByteArrayElements(ba, &isCopy);
if (isCopy == JNI_TRUE) {
// TODO
}
jsize arraySize = env->GetArrayLength( ba );
if (pArray && arraySize <= buffSize) {
// 受取り用バッファにコピー
memcpy( pBuffer, pArray, arraySize );
} else {
LOGE( "failed copy pArray:0x%08x arraySize:%d", pArray, arraySize );
}
} while(0);
env->DeleteLocalRef( classObj );
}
env->DeleteLocalRef( js );
env->ReleaseByteArrayElements(ba, pArray, JNI_ABORT);
LOGD( "file dump %x %x %x %x %x %x %x %x %x %x",
pBuffer[0], pBuffer[1], pBuffer[2], pBuffer[3], pBuffer[4], pBuffer[5], pBuffer[6], pBuffer[7], pBuffer[8], pBuffer[9] );
/** 通知を出す */
private void setNotification( CharSequence notifyMsg, CharSequence contextMsg, Intent intent) {
Notification notification = new Notification(R.drawable.test, notifyMsg, System.currentTimeMillis());
PendingIntent pIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, 0);
notification.setLatestEventInfo(
getApplicationContext(),
getText(R.string.app_name),
contextMsg,
pIntent);
//
// バイブ設定
// long の配列の場合、単位はミリ秒で {無振動, 振動, 無振動, 振動 ... } と指定する。
// システムのデフォルトの振動方式を使用する場合は、デフォルト値を使用する旨をフラグで指定。
//
//notification.vibrate = new long[] {0, 500, 0, 1000, 0};
notification.defaults |= Notification.DEFAULT_VIBRATE;
NotificationManager nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
nm.notify(1111, notification);
}
; HTC Desireこちらのページを参考にさせて頂きました。
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C87
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C87&MI_01