-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
分析后发现问题出在这里。
类 Mp4Response.java
方法 public void sendBody(Socket socket, OutputStream outputStream, long pending) throws Exception{
}
如下代码
while (bufferLength > 0 && (readLength = randomAccessFile.read(buffer, 0, (int) bufferLength)) != -1) {
offset += readLength;
outputStream.write(buffer, 0, readLength);
randomAccessFile.seek(offset);
bufferLength = (avilable - offset + 1) > bufferedSize ? bufferedSize : (avilable - offset + 1);
}
这里判断条件有问题。当第一次seek到结尾的时候,缓存文件中前面段没写入的数据,此段数据为空数据,再次往回seek,此时read 后,readLength 长度不是-1,但向buffer数组中写入的全是0,播放器接受到的全是空数据,也跳不出while循环。
Metadata
Metadata
Assignees
Labels
No labels