0
0
mirror of https://github.com/opencv/opencv.git synced 2026-01-18 17:21:42 +01:00
Anshu 8fec01d73e Merge pull request #28017 from 0AnshuAditya0:fix-audio-buffer-calculation-27969
Optimize audio buffer duration calculation in MSMF capture. Fixes #27969 #28017

### Description
Cache the repeated calculation of `(bit_per_sample/8)*nChannels` in a local variable to avoid redundant computations in `grabFrame()` and `configureAudioFrame()` functions.

### Changes
- Added `bytesPerSample` local variable in both functions
- Replaced 6 repeated calculations with the cached variable
- Improves performance in frequently called audio processing code

Fixes #27969
2025-11-17 10:52:11 +03:00
2020-02-26 15:12:45 +03:00
2018-10-11 17:57:51 +00:00
2025-08-01 09:50:10 +03:00
2024-03-03 23:37:07 +05:30

OpenCV: Open Source Computer Vision Library

Resources

Contributing

Please read the contribution guidelines before starting work on a pull request.

Summary of the guidelines:

  • One pull request per issue;
  • Choose the right base branch;
  • Include tests and documentation;
  • Clean up "oops" commits before submitting;
  • Follow the coding style guide.

Additional Resources

Description
Languages
C++ 87.5%
C 3.1%
Python 3%
CMake 2%
Java 1.5%
Other 2.7%