Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRC handling is not thread-safe #92

Open
benjamin-weiss opened this issue Jun 26, 2024 · 1 comment
Open

DRC handling is not thread-safe #92

benjamin-weiss opened this issue Jun 26, 2024 · 1 comment

Comments

@benjamin-weiss
Copy link
Contributor

The function impd_drc_read_uni_drc_gain() uses static variable pkt_loss_frm_cnt to count the number of lost packets and disable DRC if it reaches a certain time. Since it is still a global variable, several decoding threads sharing the same memory space may overwrite that value and cause DRC being disabled for another thread without a reason (or prevent it from being disabled with the counter being reset).

P.S. This seems to be the only instance where a static variable is used in the code and probably it should belong to a decoder context instead.

@SakethSathuvalli
Copy link
Member

Yes, pkg_loss_frm_cnt should have been a decoder context variable.

In the present implementation there will not be a scenario where the value can be anything other than 0. We will clean this part of the code.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants