Index: media/base/mime_util.cc |
diff --git a/media/base/mime_util.cc b/media/base/mime_util.cc |
index 00a2c744cc4bb0e2e3433f563a87d0d6a6b8d652..50a99c62f61c4a8713644595338f7a137cd41978 100644 |
--- a/media/base/mime_util.cc |
+++ b/media/base/mime_util.cc |
@@ -417,9 +417,13 @@ bool MimeUtil::AreSupportedMediaCodecs( |
void MimeUtil::ParseCodecString(const std::string& codecs, |
std::vector<std::string>* codecs_out, |
bool strip) { |
- std::string no_quote_codecs; |
- base::TrimString(codecs, "\"", &no_quote_codecs); |
- base::SplitString(no_quote_codecs, ',', codecs_out); |
+ *codecs_out = base::SplitString( |
+ base::TrimString(codecs, "\"", base::TRIM_ALL), |
+ ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
+ |
+ // Convert empty or all-whitespace input to 0 results. |
+ if (codecs_out->size() == 1 && (*codecs_out)[0].empty()) |
+ codecs_out->clear(); |
if (!strip) |
return; |