|
@@ -98,12 +98,35 @@ class VidBufferWaiter {
|
|
|
|
|
|
waitCount++;
|
|
|
final bufferedSize = channel.getBufferSize();
|
|
|
+
|
|
|
if (bufferedSize >= needBufferSize) {
|
|
|
// 缓存足够
|
|
|
+ logger.i("VidPlayer - buffer end since buffered enough");
|
|
|
+ logger.i("VidPlayer - BufferedSize: $bufferedSize.");
|
|
|
+ logger.i("VidPlayer - NeedBufferedSize: $needBufferSize.");
|
|
|
+ return finishFn();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (channel.isBufferedDone) {
|
|
|
+ // 全部缓冲完成
|
|
|
+ var fileTotalSize = channel.getFileSize();
|
|
|
+ var fileDownloadedSize = channel.getBufferSize();
|
|
|
+ logger.i("VidPlayer - buffer end since all files are downloaded");
|
|
|
+ logger.i("VidPlayer - fileTotalSize: $fileTotalSize.");
|
|
|
+ logger.i("VidPlayer - filedownloaded: $fileDownloadedSize.");
|
|
|
return finishFn();
|
|
|
}
|
|
|
|
|
|
if (waitCount >= waitCountLimit) {
|
|
|
+ //记录上方管理提前终止的逻辑未执行时的内存现场
|
|
|
+ var fileTotalSize = channel.getFileSize();
|
|
|
+ var fileDownloadedSize = channel.getBufferSize();
|
|
|
+ logger.i(
|
|
|
+ "VidPlayer - channel.isBufferedDone: ${channel.isBufferedDone}.");
|
|
|
+ logger.i("VidPlayer - BufferedSize: $bufferedSize.");
|
|
|
+ logger.i("VidPlayer - NeedBufferedSize: $needBufferSize.");
|
|
|
+ logger.i("VidPlayer - fileTotalSize: $fileTotalSize.");
|
|
|
+ logger.i("VidPlayer - filedownloaded: $fileDownloadedSize.");
|
|
|
// 等待超时
|
|
|
final bufferredSizeNow = channel.getBufferSize();
|
|
|
if (bufferredSizeNow - bufferredSize < 1024) {
|