From 6709dc7f6439c77a8bcfa5a8f5b1a820cea517fc Mon Sep 17 00:00:00 2001 From: eguven Date: Tue, 30 Jan 2018 01:13:00 -0800 Subject: [PATCH] Enable caching for data loaded by ParsingLoadable This enables caching manifest files for DASH, HLS and SmoothStreaming. To disable caching a non cache DataSource should be provided for reading manifest to the used MediaSource. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=183794252 --- .../google/android/exoplayer2/upstream/ParsingLoadable.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/ParsingLoadable.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/ParsingLoadable.java index 308340b8b2..a9927f6e86 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/ParsingLoadable.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/ParsingLoadable.java @@ -72,7 +72,11 @@ public final class ParsingLoadable implements Loadable { * @param parser Parses the object from the response. */ public ParsingLoadable(DataSource dataSource, Uri uri, int type, Parser parser) { - this(dataSource, new DataSpec(uri, DataSpec.FLAG_ALLOW_GZIP), type, parser); + this( + dataSource, + new DataSpec(uri, DataSpec.FLAG_ALLOW_GZIP | DataSpec.FLAG_ALLOW_CACHING_UNKNOWN_LENGTH), + type, + parser); } /**