Skip to content

Commit

Permalink
Fix accessing sequence of null SequenceInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Sep 25, 2024
1 parent 2d88c29 commit b3fde19
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ private void updateGlobalSequence() {
file.parseHeaders();

SequenceInfo sequenceInfo = extractAbsoluteSequenceFromEvent(file.getLastEventMessage());
state.globalSequence = sequenceInfo.sequence;
state.globalSequenceDuration = sequenceInfo.duration;

if (sequenceInfo != null) {
state.globalSequence = sequenceInfo.sequence;
state.globalSequenceDuration = sequenceInfo.duration;
}
} catch (IOException ignored) {

}
Expand Down Expand Up @@ -194,7 +197,11 @@ private void processSegmentStream(SeekableInputStream stream, AudioProcessingCon
if (!trackInfo.isStream) {
state.absoluteSequence++;
} else {
state.absoluteSequence = extractAbsoluteSequenceFromEvent(file.getLastEventMessage()).sequence;
SequenceInfo sequenceInfo = extractAbsoluteSequenceFromEvent(file.getLastEventMessage());

if (sequenceInfo != null) {
state.absoluteSequence = sequenceInfo.sequence;
}
}

if (state.trackConsumer == null) {
Expand Down

0 comments on commit b3fde19

Please sign in to comment.