Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(969)

Unified Diff: media/base/android/media_codec_util.cc

Issue 2046253002: When HLS redirects are encountered recreate WebMediaPlayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile failures. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/media_codec_util.h ('k') | media/blink/buffered_data_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_codec_util.cc
diff --git a/media/base/android/media_codec_util.cc b/media/base/android/media_codec_util.cc
index 6fde55954469c594f0da1ef65935823b9d8b42de..2f8e037ff5a187676088b34d96c14ea4a1294eef 100644
--- a/media/base/android/media_codec_util.cc
+++ b/media/base/android/media_codec_util.cc
@@ -178,23 +178,15 @@ bool MediaCodecUtil::IsKnownUnaccelerated(const std::string& android_mime_type,
// static
bool MediaCodecUtil::IsHLSPath(const GURL& url) {
- if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
- return false;
-
- std::string path = url.path();
- return base::EndsWith(path, ".m3u8", base::CompareCase::INSENSITIVE_ASCII);
+ return (url.SchemeIsHTTPOrHTTPS() || url.SchemeIsFile()) &&
+ base::EndsWith(url.path(), ".m3u8",
+ base::CompareCase::INSENSITIVE_ASCII);
}
// static
bool MediaCodecUtil::IsHLSURL(const GURL& url) {
- if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
- return false;
-
- std::string spec = url.spec();
- if (base::EndsWith(spec, ".m3u8", base::CompareCase::INSENSITIVE_ASCII))
- return true;
-
- return (spec.find("m3u8") != std::string::npos);
+ return (url.SchemeIsHTTPOrHTTPS() || url.SchemeIsFile()) &&
+ url.spec().find("m3u8") != std::string::npos;
}
// static
« no previous file with comments | « media/base/android/media_codec_util.h ('k') | media/blink/buffered_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698