Skip to content

Commit

Permalink
fix: prevent changing undefined baseStartTime to NaN (#1086)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey committed Mar 5, 2021
1 parent ccd9352 commit 43aa69a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util/segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import { ONE_SECOND_IN_TS } from 'mux.js/lib/utils/clock';
* whether it contains video and/or audio
*/
export const probeTsSegment = (bytes, baseStartTime) => {
const timeInfo = tsInspector.inspect(bytes, baseStartTime * ONE_SECOND_IN_TS);
const tsStartTime = (typeof baseStartTime === 'number' && !isNaN(baseStartTime)) ?
(baseStartTime * ONE_SECOND_IN_TS) :
void 0;
const timeInfo = tsInspector.inspect(bytes, tsStartTime);

if (!timeInfo) {
return null;
Expand Down

0 comments on commit 43aa69a

Please sign in to comment.