Changeset 269829 in webkit


Ignore:
Timestamp:
Nov 15, 2020 9:47:17 AM (3 years ago)
Author:
youenn@apple.com
Message:

AudioSampleDataSource::pullSamplesInternal does not need to pass its sampleCount parameter as in/out
https://bugs.webkit.org/show_bug.cgi?id=218899

Reviewed by Eric Carlson.

pullSamplesInternal sets sampleCount to zero in some cases where pullSamplesInternal returns false.
pullSamplesInternal callers do not use the sampleCount parameter if pullSamplesInternal returns false.
Pass sampleCount by value to clarify the behavior and remove setting sampleCount to zero in pullSamplesInternal return false case.

No change of behavior.

  • platform/audio/cocoa/AudioSampleDataSource.h:
  • platform/audio/cocoa/AudioSampleDataSource.mm:

(WebCore::AudioSampleDataSource::pullSamplesInternal):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r269828 r269829  
     12020-11-15  Youenn Fablet  <youenn@apple.com>
     2
     3        AudioSampleDataSource::pullSamplesInternal does not need to pass its sampleCount parameter as in/out
     4        https://bugs.webkit.org/show_bug.cgi?id=218899
     5
     6        Reviewed by Eric Carlson.
     7
     8        pullSamplesInternal sets sampleCount to zero in some cases where pullSamplesInternal returns false.
     9        pullSamplesInternal callers do not use the sampleCount parameter if pullSamplesInternal returns false.
     10        Pass sampleCount by value to clarify the behavior and remove setting sampleCount to zero in pullSamplesInternal return false case.
     11
     12        No change of behavior.
     13
     14        * platform/audio/cocoa/AudioSampleDataSource.h:
     15        * platform/audio/cocoa/AudioSampleDataSource.mm:
     16        (WebCore::AudioSampleDataSource::pullSamplesInternal):
     17
    1182020-11-15  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.h

    r268521 r269829  
    8484
    8585    OSStatus setupConverter();
    86     bool pullSamplesInternal(AudioBufferList&, size_t&, uint64_t, double, PullMode);
     86    bool pullSamplesInternal(AudioBufferList&, size_t, uint64_t, double, PullMode);
    8787
    8888    void pushSamplesInternal(const AudioBufferList&, const MediaTime&, size_t frameCount);
  • trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm

    r268577 r269829  
    208208}
    209209
    210 bool AudioSampleDataSource::pullSamplesInternal(AudioBufferList& buffer, size_t& sampleCount, uint64_t timeStamp, double /*hostTime*/, PullMode mode)
     210bool AudioSampleDataSource::pullSamplesInternal(AudioBufferList& buffer, size_t sampleCount, uint64_t timeStamp, double /*hostTime*/, PullMode mode)
    211211{
    212212    size_t byteCount = sampleCount * m_outputDescription->bytesPerFrame();
     
    215215    if (buffer.mNumberBuffers != m_ringBuffer->channelCount()) {
    216216        AudioSampleBufferList::zeroABL(buffer, byteCount);
    217         sampleCount = 0;
    218217        return false;
    219218    }
     
    221220    if (!m_ringBuffer || m_muted || m_inputSampleOffset == MediaTime::invalidTime()) {
    222221        AudioSampleBufferList::zeroABL(buffer, byteCount);
    223         sampleCount = 0;
    224222        return false;
    225223    }
     
    233231        if (buffered < sampleCount * 2 || (m_endFrameWhenNotEnoughData && m_endFrameWhenNotEnoughData == endFrame)) {
    234232            AudioSampleBufferList::zeroABL(buffer, byteCount);
    235             sampleCount = 0;
    236233            return false;
    237234        }
Note: See TracChangeset for help on using the changeset viewer.