Skip to content

Commit

Permalink
MediaCapabilities: Assume a framerate of 30fps since decodingInfo wi…
Browse files Browse the repository at this point in the history
…ll throw with Level default of 0.
  • Loading branch information
robwalch committed Aug 10, 2023
1 parent f9042ac commit b5964c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/controller/abr-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,13 @@ class AbrController implements AbrComponentAPI {
);
levelInfo.supportedPromise.then((decodingInfo) => {
levelInfo.supportedResult = decodingInfo;
if (!decodingInfo.supported) {
if (decodingInfo.error) {
logger.warn(
`[abr] MediaCapabilities decodingInfo error: "${
decodingInfo.error
}" for level ${i} ${JSON.stringify(decodingInfo)}`
);
} else if (!decodingInfo.supported) {
logger.warn(
`[abr] Removing unsupported level ${i} after MediaCapabilities decodingInfo check failed ${JSON.stringify(
decodingInfo
Expand Down
3 changes: 2 additions & 1 deletion src/utils/mediacapabilities-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export function getMediaDecodingInfoPromise(
width: level.width,
height: level.height,
bitrate: Math.ceil(Math.max(level.bitrate * 0.9, level.averageBitrate)),
framerate: level.frameRate,
// Assume a framerate of 30fps since MediaCapabilities will not accept Level default of 0.
framerate: level.frameRate || 30,
};

const videoRange = level.videoRange;
Expand Down

0 comments on commit b5964c9

Please sign in to comment.