Commit 6f2891e5 by olly Committed by Ian Baker

Remove usages of deprecated CacheDataSourceFactory

PiperOrigin-RevId: 307684243
parent 4abaaf13
......@@ -52,7 +52,7 @@ public final class CacheDataSourceFactory implements DataSource.Factory {
cache,
upstreamFactory,
new FileDataSource.Factory(),
new CacheDataSinkFactory(cache, CacheDataSink.DEFAULT_FRAGMENT_SIZE),
new CacheDataSink.Factory().setCache(cache),
flags,
/* eventListener= */ null);
}
......
......@@ -27,10 +27,9 @@ import com.google.android.exoplayer2.source.dash.manifest.DashManifest;
import com.google.android.exoplayer2.source.dash.manifest.Representation;
import com.google.android.exoplayer2.source.dash.offline.DashDownloader;
import com.google.android.exoplayer2.testutil.HostActivity;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
import com.google.android.exoplayer2.upstream.DummyDataSource;
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory;
import com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor;
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
import com.google.android.exoplayer2.util.Util;
......@@ -56,8 +55,8 @@ public final class DashDownloadTest {
private DashTestRunner testRunner;
private File tempFolder;
private SimpleCache cache;
private DefaultHttpDataSourceFactory httpDataSourceFactory;
private CacheDataSourceFactory offlineDataSourceFactory;
private DataSource.Factory httpDataSourceFactory;
private DataSource.Factory offlineDataSourceFactory;
@Before
public void setUp() throws Exception {
......@@ -71,9 +70,7 @@ public final class DashDownloadTest {
tempFolder = Util.createTempDirectory(testRule.getActivity(), "ExoPlayerTest");
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
httpDataSourceFactory = new DefaultHttpDataSourceFactory("ExoPlayer", null);
offlineDataSourceFactory =
new CacheDataSourceFactory(
cache, DummyDataSource.FACTORY, CacheDataSource.FLAG_BLOCK_ON_CACHE);
offlineDataSourceFactory = new CacheDataSource.Factory().setCache(cache);
}
@After
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment