Skip to content

Commit

Permalink
Revert changes to player_test_fixture.h/cc.
Browse files Browse the repository at this point in the history
These no longer seem necessary; SbPlayerWriteSampleTests* tests pass
without the changes to ConvertDurationToAudioBufferCount.

Change-Id: I468755257d5c1cb2ff38fbb300f3724de4617697
  • Loading branch information
antoniori-eng committed Mar 25, 2024
1 parent ceed934 commit 85a752d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 4 additions & 8 deletions starboard/nplb/player_test_fixture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,20 +376,16 @@ int SbPlayerTestFixture::ConvertDurationToAudioBufferCount(
int64_t duration) const {
SB_DCHECK(HasAudio());
SB_DCHECK(audio_dmp_reader_->number_of_audio_buffers());
return std::max(
1,
static_cast<int>(duration * audio_dmp_reader_->number_of_audio_buffers() /
audio_dmp_reader_->audio_duration()));
return duration * audio_dmp_reader_->number_of_audio_buffers() /
audio_dmp_reader_->audio_duration();
}

int SbPlayerTestFixture::ConvertDurationToVideoBufferCount(
int64_t duration) const {
SB_DCHECK(HasVideo());
SB_DCHECK(video_dmp_reader_->number_of_video_buffers());
return std::max(
1,
static_cast<int>(duration * video_dmp_reader_->number_of_video_buffers() /
video_dmp_reader_->video_duration()));
return duration * video_dmp_reader_->number_of_video_buffers() /
video_dmp_reader_->video_duration();
}

// static
Expand Down
3 changes: 0 additions & 3 deletions starboard/nplb/player_test_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ class SbPlayerTestFixture {
bool HasVideo() const { return video_dmp_reader_; }

int64_t GetAudioSampleTimestamp(int index) const;

// Returns the number of buffers that contains |duration| worth of audio or
// video. Returns at minimum 1 buffer.
int ConvertDurationToAudioBufferCount(int64_t duration) const;
int ConvertDurationToVideoBufferCount(int64_t duration) const;

Expand Down

0 comments on commit 85a752d

Please sign in to comment.