pion / mediadevices

Go implementation of the MediaDevices API.
https://pion.ly/
MIT License
521 stars 120 forks source link

fix cLen in nocgo implementation of i444Toi420 #486

Closed neversi closed 1 year ago

neversi commented 1 year ago

Description

Fix the length of buffer - cLen in i444toI420() in nocgo implementation

neversi commented 1 year ago

While optimizing copy of buffers in nocgo implementation, I have faced with this bug.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +0.02 :tada:

Comparison is base (30badd8) 58.83% compared to head (08b53df) 58.85%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #486 +/- ## ========================================== + Coverage 58.83% 58.85% +0.02% ========================================== Files 62 62 Lines 3741 3753 +12 ========================================== + Hits 2201 2209 +8 - Misses 1413 1416 +3 - Partials 127 128 +1 ``` [see 1 file with indirect coverage changes](https://codecov.io/gh/pion/mediadevices/pull/486/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

neversi commented 1 year ago

@edaniels could you please at this bug?

edaniels commented 1 year ago

Hi @neversi, can you write a test for this? Thanks!

neversi commented 1 year ago

@edaniels it can be reproduced by tests with CGO_ENABLED=0

Also, I have added mock scaler to be able to pass tests for nocgo implementation and fix the ratio for i422 converter.

Now all tests pass without errors