Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Ensure that MP3, FLAC, and PCM are not supported for MediaSource." #2005

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
// 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) {

Check warning on line 125 in cobalt/media/media_module.cc

View check run for this annotation

Codecov / codecov/patch

cobalt/media/media_module.cc#L124-L125

Added lines #L124 - L125 were not covered by tests
support_type = kSbMediaSupportTypeNotSupported;
} else {
support_type = CanPlayType(mime_type, "");
Expand All @@ -135,16 +135,8 @@
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);

Check warning on line 139 in cobalt/media/media_module.cc

View check run for this annotation

Codecov / codecov/patch

cobalt/media/media_module.cc#L139

Added line #L139 was not covered by tests
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.

Loading