Skip to content

Commit

Permalink
Revert "Ensure that MP3, FLAC, and PCM are not supported for MediaSou…
Browse files Browse the repository at this point in the history
…rce." (youtube#2005)

Reverts youtube#1359

b/297060983
  • Loading branch information
jasonzhangxx authored Nov 22, 2023
1 parent fbfbaa7 commit 85e1b18
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 93 deletions.
1 change: 0 additions & 1 deletion cobalt/media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ target(gtest_target_type, "media_test") {
"base/decoder_buffer_cache_test.cc",
"bidirectional_fit_reuse_allocator_test.cc",
"file_data_source_test.cc",
"media_module_test.cc",
"progressive/demuxer_extension_wrapper_test.cc",
"progressive/mock_data_source_reader.h",
"progressive/mp4_map_unittest.cc",
Expand Down
14 changes: 3 additions & 11 deletions cobalt/media/media_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ class CanPlayTypeHandlerStarboard : public CanPlayTypeHandler {
// progressive.
SbMediaSupportType support_type;
media::FormatSupportQueryMetrics metrics;
if (strstr(mime_type.c_str(), "video/mp4") == NULL &&
strstr(mime_type.c_str(), "application/x-mpegURL") == NULL) {
if (strstr(mime_type.c_str(), "video/mp4") == 0 &&
strstr(mime_type.c_str(), "application/x-mpegURL") == 0) {
support_type = kSbMediaSupportTypeNotSupported;
} else {
support_type = CanPlayType(mime_type, "");
Expand All @@ -135,16 +135,8 @@ class CanPlayTypeHandlerStarboard : public CanPlayTypeHandler {
SbMediaSupportType CanPlayAdaptive(
const std::string& mime_type,
const std::string& key_system) const override {
SbMediaSupportType support_type;
media::FormatSupportQueryMetrics metrics;
// Only mp4 and webm videos are supported for adaptive playback in Cobalt;
// any other containers can be immediately rejected.
if (strstr(mime_type.c_str(), "video/mp4") == NULL &&
strstr(mime_type.c_str(), "video/webm") == NULL) {
support_type = kSbMediaSupportTypeNotSupported;
} else {
support_type = CanPlayType(mime_type, key_system);
}
SbMediaSupportType support_type = CanPlayType(mime_type, key_system);
metrics.RecordAndLogQuery("MediaSource::IsTypeSupported", mime_type,
key_system, support_type);
return support_type;
Expand Down
81 changes: 0 additions & 81 deletions cobalt/media/media_module_test.cc

This file was deleted.

0 comments on commit 85e1b18

Please sign in to comment.