Skip to content

clearQueue() not setting queue size to 0 #541

@matej-dataqueue

Description

@matej-dataqueue

Select which package(s) are affected

@livekit/rtc-node

Describe the bug

Expected

After calling clearQueue(), I expect queuedDuration to be 0.

Current

After calling clearQueue(), queuedDuration does not get set to 0.

Reproduction

// capture some frames...
audioSource.clearQueue()
console.log(audioSource.queuedDuration) // this will not be 0!

Can be avoided using a workaround:

// capture some frames...
void audioSource.waitForPlayout()
audioSource.clearQueue()
console.log(audioSource.queuedDuration) // this will be 0 after `waitForPlayout()` returns

Logs

System Info

not relevant

LiveKit server version

LiveKit cloud

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions