danikula / danikula/AndroidVideoCache

Seek issue,use too much time.

オープン
#215 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
5.5k
フォーク
1.2k
PR マージ指標
30日以内にマージされた PR はありません

説明

```
private boolean isUseCache(GetRequest request) throws ProxyCacheException {
long sourceLength = source.length();
boolean sourceLengthKnown = sourceLength > 0;
long cacheAvailable = cache.available();
// do not use cache for partial requests which too far from available cache. It seems user seek video.
// return !sourceLengthKnown || !request.partial || request.rangeOffset <= cacheAvailable + sourceLength * NO_CACHE_BARRIER;
return !sourceLengthKnown || !request.partial || request.rangeOffset <= cacheAvailable;// + sourceLength * NO_CACHE_BARRIER;
}
```

HTTP MP4 file, if the duration too long, "sourceLength * NO_CACHE_BARRIER" well be a **BIG number**, fetch cache from network will coast too much time, seek blocked.
Remove the added number, seek works normally.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。