Skip to content

Commit

Permalink
Cherry pick PR #2892: [android] Fix PlayerComponentsTest and SbPlayer…
Browse files Browse the repository at this point in the history
…Test failures (#2931)

Refer to the original PR: #2892

When video codec is none, it failed on check on
|creation_parameters.video_mime()|, which causes the tests failed.

b/333760574
b/320568573

Co-authored-by: Bo-Rong Chen <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and borongc committed Apr 13, 2024
1 parent 58d3b3d commit d214884
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions starboard/android/shared/player_components_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player::
}

bool enable_flush_during_seek = false;
if (!creation_parameters.video_mime().empty()) {
if (creation_parameters.video_codec() != kSbMediaVideoCodecNone &&
!creation_parameters.video_mime().empty()) {
MimeType video_mime_type(creation_parameters.video_mime());
if (video_mime_type.ValidateBoolParameter("enableflushduringseek")) {
enable_flush_during_seek =
Expand Down Expand Up @@ -511,7 +512,8 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player::
std::string* error_message) {
bool force_big_endian_hdr_metadata = false;
bool enable_flush_during_seek = false;
if (!creation_parameters.video_mime().empty()) {
if (creation_parameters.video_codec() != kSbMediaVideoCodecNone &&
!creation_parameters.video_mime().empty()) {
// Use mime param to determine endianness of HDR metadata. If param is
// missing or invalid it defaults to Little Endian.
MimeType video_mime_type(creation_parameters.video_mime());
Expand Down

0 comments on commit d214884

Please sign in to comment.