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

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

Issue 2095053003: Merge M52: "When HLS redirects are encountered recreate WebMediaPlayer." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: 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 c01aabe826be829edcca7d7a4cc1461b2bdccdc9..2a418ecec36866816e9860d82102aac749399484 100644
--- a/media/base/android/media_codec_util.cc
+++ b/media/base/android/media_codec_util.cc
@@ -176,23 +176,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