VirtualBox

Ignore:
Timestamp:
May 31, 2021 8:16:30 PM (4 years ago)
Author:
vboxsync
Message:

ValKit/AudioTest: Make sure audioTestPlayOne reads a frame aligned number of bytes from the file or we'll get into trouble. bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp

    r89403 r89413  
    16041604                if (RT_SUCCESS(rc))
    16051605                {
    1606                     uint64_t const nsStarted = RTTimeNanoTS();
     1606                    uint64_t const  nsStarted = RTTimeNanoTS();
    16071607
    16081608                    /*
    16091609                     * Transfer data as quickly as we're allowed.
    16101610                     */
     1611                    uint8_t         abSamples[16384];
     1612                    uint32_t const  cbSamplesAligned = PDMAudioPropsFloorBytesToFrame(&pStream->Props, sizeof(abSamples));
    16111613                    for (;;)
    16121614                    {
    16131615                        /* Read a chunk from the wave file. */
    1614                         uint8_t  abSamples[16384];
    16151616                        size_t   cbSamples = 0;
    1616                         rc = AudioTestWaveFileRead(&WaveFile, abSamples, sizeof(abSamples), &cbSamples);
     1617                        rc = AudioTestWaveFileRead(&WaveFile, abSamples, cbSamplesAligned, &cbSamples);
    16171618                        if (RT_SUCCESS(rc) && cbSamples > 0)
    16181619                        {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette