diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 90948ef..e17979d 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,6 +1,6 @@ - + @@ -13,71 +13,71 @@ - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + - - - - - - - + + + + + - - - - - + + + + + diff --git a/androidserialport.cpp b/androidserialport.cpp index e7e2654..2cedc77 100644 --- a/androidserialport.cpp +++ b/androidserialport.cpp @@ -64,6 +64,7 @@ int AndroidSerialPort::write(char *data, int s) jbyteArray buffer = env->NewByteArray(s); env->SetByteArrayRegion(buffer, 0, s, (jbyte *)data); serialJavaObject.callMethod("write", "([B)V", buffer); + env->DeleteLocalRef(buffer); return 0; } @@ -73,6 +74,7 @@ int AndroidSerialPort::write(QByteArray data) jbyteArray buffer = env->NewByteArray(data.size()); env->SetByteArrayRegion(buffer, 0, data.size(), (jbyte *)data.data()); serialJavaObject.callMethod("write", "([B)V", buffer); + env->DeleteLocalRef(buffer); return 0; } diff --git a/nxdncodec.cpp b/nxdncodec.cpp index 18a2f90..26f494a 100755 --- a/nxdncodec.cpp +++ b/nxdncodec.cpp @@ -282,7 +282,6 @@ void NXDNCodec::send_disconnect() void NXDNCodec::transmit() { - uint8_t ambe_frame[49]; uint8_t ambe[7]; int16_t pcm[160]; @@ -314,13 +313,11 @@ void NXDNCodec::transmit() } else{ if(m_modeinfo.sw_vocoder_loaded){ - m_mbevocoder->encode_2450(pcm, ambe_frame); + m_mbevocoder->encode_2450(pcm, ambe); } + ambe[6] &= 0x80; + for(int i = 0; i < 7; ++i){ - for(int j = 0; j < 8; ++j){ - ambe[i] |= (ambe_frame[(i*8)+j] << (7-j)); - } - ambe[6] &= 0x80; m_txcodecq.append(ambe[i]); } }