Skip to content

Commit

Permalink
[android] Enable filtered partial audio tests
Browse files Browse the repository at this point in the history
b/274021285
  • Loading branch information
jasonzhangxx committed Aug 23, 2023
1 parent 61e7127 commit ed2814b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
6 changes: 0 additions & 6 deletions starboard/android/shared/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,9 @@
# TODO: Filter this test on a per-device basis.
'SbMediaCanPlayMimeAndKeySystem.MinimumSupport',

# TODO: b/289281412 Make this test work on lab devices consistently.
'SbPlayerWriteSampleTests/SbPlayerWriteSampleTest.PartialAudio/*',

# TODO: b/292319097 Make this test work on lab devices consistently.
'SbPlayerTest.MaxVideoCapabilities',

# TODO: b/292409536 Make this test fork on lab devices consistently.
'SbPlayerWriteSampleTests/SbPlayerWriteSampleTest.PartialAudioDiscardAll/*',

# TODO: b/280432564 Make this test work on lab devices consistently.
'SbAudioSinkTest.ContinuousAppend',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ void AudioFrameDiscarder::AdjustForDiscardedDurations(
scoped_refptr<DecodedAudio>* decoded_audio) {
SB_DCHECK(decoded_audio);
SB_DCHECK(*decoded_audio);
// TODO: Comment out the SB_DCHECK due to b/274021285. We can re-enable it
// after b/274021285 is resolved.
// SB_DCHECK(!input_buffer_infos_.empty());
SB_DCHECK(!input_buffer_infos_.empty());

if (input_buffer_infos_.empty()) {
SB_LOG(WARNING) << "Inconsistent number of audio decoder outputs. Received "
Expand All @@ -60,11 +58,16 @@ void AudioFrameDiscarder::AdjustForDiscardedDurations(
}

auto info = input_buffer_infos_.front();
SB_LOG_IF(WARNING, info.timestamp != (*decoded_audio)->timestamp())
<< "Inconsistent timestamps between InputBuffer (@" << info.timestamp
<< ") and DecodedAudio (@" << (*decoded_audio)->timestamp() << ").";
input_buffer_infos_.pop();

// The timestamps may have a small offset due to the precision of computation.
if (std::abs(info.timestamp - (*decoded_audio)->timestamp()) > 10) {
SB_LOG(WARNING) << "Inconsistent timestamps between InputBuffer (@"
<< info.timestamp << ") and DecodedAudio (@"
<< (*decoded_audio)->timestamp() << ").";
return;

Check warning on line 68 in starboard/shared/starboard/player/filter/audio_frame_discarder.cc

View check run for this annotation

Codecov / codecov/patch

starboard/shared/starboard/player/filter/audio_frame_discarder.cc#L65-L68

Added lines #L65 - L68 were not covered by tests
}

(*decoded_audio)
->AdjustForDiscardedDurations(sample_rate,
info.discarded_duration_from_front,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ namespace filter {
// corresponding InputBuffer object isn't available at the time.
// This class assumes that there is exact one DecodedAudio object produced for
// one InputBuffer object, which may not always be the case.
// TODO(b/274021285): Ensure that the class works when there isn't a 1:1
// relationship between DecodedAudio and InputBuffer.
class AudioFrameDiscarder {
public:
void OnInputBuffers(const InputBuffers& input_buffers);
Expand Down

0 comments on commit ed2814b

Please sign in to comment.