|
@@ -215,8 +215,8 @@
|
|
|
var data = ParseProto(event.data); //JAVA服务器转发
|
|
|
var input = new Uint8Array(event.data);
|
|
|
if (data.audio != null) { //喂音频
|
|
|
- if(input[0] == 0xff) {
|
|
|
- if(isFinish) {
|
|
|
+ if (input[0] == 0xff) {
|
|
|
+ if (isFinish) {
|
|
|
decodeAAC(input);
|
|
|
}
|
|
|
}
|
|
@@ -269,7 +269,7 @@
|
|
|
|
|
|
if (pcmLen >= 0) {
|
|
|
var pcmData = new Uint8Array(pcmLen);
|
|
|
- for (i = 0; i < pcmLen; i++) {
|
|
|
+ for (var i = 0; i < pcmLen; i++) {
|
|
|
pcmData[i] = Module.HEAPU8[(retPtr) + i]
|
|
|
}
|
|
|
|
|
@@ -299,10 +299,16 @@
|
|
|
}
|
|
|
}
|
|
|
} else if (input[0] == 0xff) {
|
|
|
+ if (!isEnough) {
|
|
|
+ requestCount++;
|
|
|
+ }
|
|
|
audio = input;
|
|
|
- if (isFinish) {
|
|
|
- decodeAAC(input);
|
|
|
+
|
|
|
+ if (new Date().getTime() - curTime > 100) {
|
|
|
+ delayTime = new Date().getTime();
|
|
|
}
|
|
|
+ curTime = new Date().getTime();
|
|
|
+ duration = 24;
|
|
|
} else if (input[0] == 0x68) {
|
|
|
if (input[23] == 0x05) { //横竖屏标识
|
|
|
var state = CheckScreenDirection(input.slice(24, 24 + 8));
|