Skip to content

Commit

Permalink
fix(YoutubeMpegStreamAudioTrack): default to 0 if state.absoluteSeque…
Browse files Browse the repository at this point in the history
…nce is null
  • Loading branch information
devoxin committed Dec 31, 2023
1 parent 049a241 commit 16d82e2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public long getDuration() {

@Override
public long getPosition() {
if (state.absoluteSequence == null) {
// We haven't yet received a stream segment so absoluteSequence hasn't been set yet.
return 0;
}

return TimeUnit.SECONDS.toMillis(state.absoluteSequence * TimeUnit.MILLISECONDS.toSeconds(state.globalSequenceDuration));
}

Expand Down

0 comments on commit 16d82e2

Please sign in to comment.