Skip to content

Commit

Permalink
Add SB_API_VERSION checks for new codecs.
Browse files Browse the repository at this point in the history
Bug: b/270621457
  • Loading branch information
antoniori-eng committed Dec 15, 2023
1 parent 950a044 commit 95757cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions starboard/nplb/media_can_play_mime_and_key_system_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ TEST(SbMediaCanPlayMimeAndKeySystem, FLAKY_ValidatePerformance) {

#if defined(USE_CONTRIB_CAST)
TEST(SbMediaCanPlayMimeAndKeySystem, CastCodecsAreSupported) {
#if SB_API_VERSION >= 14
// FLAC
EXPECT_EQ(SbMediaCanPlayMimeAndKeySystem("audio/ogg; codecs=\"flac\";", ""),
kSbMediaSupportTypeProbably);
Expand All @@ -973,6 +974,7 @@ TEST(SbMediaCanPlayMimeAndKeySystem, CastCodecsAreSupported) {
// PCM
EXPECT_EQ(SbMediaCanPlayMimeAndKeySystem("audio/wav; codecs=\"1\";", ""),
kSbMediaSupportTypeProbably);
#endif // SB_API_VERSION >= 14

// Vorbis
EXPECT_EQ(
Expand Down
2 changes: 2 additions & 0 deletions starboard/shared/starboard/player/video_dmp_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ std::string VideoDmpReader::audio_mime_type() const {
case kSbMediaAudioCodecVorbis:
ss << "audio/webm; codecs=\"vorbis\";";
break;
#if SB_API_VERSION >= 14
case kSbMediaAudioCodecMp3:
ss << "audio/mpeg";
break;
Expand All @@ -163,6 +164,7 @@ std::string VideoDmpReader::audio_mime_type() const {
case kSbMediaAudioCodecPcm:
ss << "audio/wav; codecs=\"1\";";
break;
#endif // SB_API_VERSION >= 14

Check warning on line 167 in starboard/shared/starboard/player/video_dmp_reader.cc

View check run for this annotation

Codecov / codecov/patch

starboard/shared/starboard/player/video_dmp_reader.cc#L154-L167

Added lines #L154 - L167 were not covered by tests
default:
SB_NOTREACHED() << "Unsupported audio codec: " << dmp_info_.audio_codec;

Check warning on line 169 in starboard/shared/starboard/player/video_dmp_reader.cc

View check run for this annotation

Codecov / codecov/patch

starboard/shared/starboard/player/video_dmp_reader.cc#L169

Added line #L169 was not covered by tests
}
Expand Down

0 comments on commit 95757cd

Please sign in to comment.