Skip to content

Commit

Permalink
fix metrics when using null decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
vpalmisano committed May 9, 2024
1 parent 69ec2d3 commit 6104699
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion scripts/peer-connection-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ async function getPeerConnectionStats(
concealmentEvents,
insertedSamplesForDeceleration,
removedSamplesForAcceleration,
keyFramesDecoded,
} = s
Object.assign(values.inboundRtp, {
kind,
Expand Down Expand Up @@ -402,6 +403,7 @@ async function getPeerConnectionStats(
concealmentEvents,
insertedSamplesForDeceleration,
removedSamplesForAcceleration,
keyFramesDecoded,
})
} else if (s.type === 'remote-candidate') {
values.remoteAddress = s.address
Expand Down Expand Up @@ -431,7 +433,7 @@ async function getPeerConnectionStats(
// Update video framesPerSecond.
if (
values.inboundRtp.kind === 'video' &&
values.inboundRtp.decoderImplementation !== 'NullVideoDecoder'
values.inboundRtp.keyFramesDecoded > 0
) {
const frames = positiveDiff(
values.inboundRtp.framesReceived,
Expand Down
5 changes: 1 addition & 4 deletions src/rtcstats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,7 @@ export function updateRtcStats(
)
})
}
if (
inboundRtp.kind === 'video' &&
inboundRtp.decoderImplementation !== 'unknown'
) {
if (inboundRtp.kind === 'video' && inboundRtp.keyFramesDecoded > 0) {
//setStats(stats, prefix + 'FramesDecoded', key, inboundRtp.framesDecoded
setStats(
stats,
Expand Down

0 comments on commit 6104699

Please sign in to comment.