⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278333 in webkit


Ignore:
Timestamp:
Jun 1, 2021, 5:14:56 PM (5 years ago)
Author:
Chris Dumez
Message:

Drop unused AudioChannel::resizeSmaller()
https://bugs.webkit.org/show_bug.cgi?id=226516

Reviewed by Sam Weinig.

  • platform/audio/AudioBus.cpp:
  • platform/audio/AudioBus.h:
  • platform/audio/AudioChannel.cpp:
  • platform/audio/AudioChannel.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r278331 r278333  
     12021-06-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Drop unused AudioChannel::resizeSmaller()
     4        https://bugs.webkit.org/show_bug.cgi?id=226516
     5
     6        Reviewed by Sam Weinig.
     7
     8        * platform/audio/AudioBus.cpp:
     9        * platform/audio/AudioBus.h:
     10        * platform/audio/AudioChannel.cpp:
     11        * platform/audio/AudioChannel.h:
     12
    1132021-06-01  Wenson Hsieh  <wenson_hsieh@apple.com>
    214
  • trunk/Source/WebCore/platform/audio/AudioBus.cpp

    r270468 r278333  
    7474}
    7575
    76 void AudioBus::resizeSmaller(size_t newLength)
    77 {
    78     ASSERT(newLength <= m_length);
    79     if (newLength <= m_length)
    80         m_length = newLength;
    81 
    82     for (unsigned i = 0; i < m_channels.size(); ++i)
    83         m_channels[i]->resizeSmaller(newLength);
    84 }
    85 
    8676void AudioBus::zero()
    8777{
  • trunk/Source/WebCore/platform/audio/AudioBus.h

    r267544 r278333  
    8484    size_t length() const { return m_length; }
    8585
    86     // resizeSmaller() can only be called with a new length <= the current length.
    87     // The data stored in the bus will remain undisturbed.
    88     void resizeSmaller(size_t newLength);
    89 
    9086    // Sample-rate : 0.0 if unknown or "don't care"
    9187    float sampleRate() const { return m_sampleRate; }
  • trunk/Source/WebCore/platform/audio/AudioChannel.cpp

    r268026 r278333  
    3838
    3939namespace WebCore {
    40 
    41 void AudioChannel::resizeSmaller(size_t newLength)
    42 {
    43     ASSERT(newLength <= m_length);
    44     if (newLength <= m_length)
    45         m_length = newLength;
    46 }
    4740
    4841void AudioChannel::scale(float scale)
  • trunk/Source/WebCore/platform/audio/AudioChannel.h

    r267544 r278333  
    4545
    4646    // Reference an external buffer.
    47     explicit AudioChannel(float* storage, size_t length)
    48         : m_length(length)
    49         , m_rawPointer(storage)
     47    AudioChannel(float* storage, size_t length)
     48        : m_rawPointer(storage)
     49        , m_length(length)
    5050        , m_silent(false)
    5151    {
     
    5454    // Manage storage for us.
    5555    explicit AudioChannel(size_t length)
    56         : m_length(length)
     56        : m_memBuffer(makeUnique<AudioFloatArray>(length))
     57        , m_length(length)
    5758    {
    58         m_memBuffer = makeUnique<AudioFloatArray>(length);
    5959    }
    6060
     
    7474    // How many sample-frames do we contain?
    7575    size_t length() const { return m_length; }
    76 
    77     // resizeSmaller() can only be called with a new length <= the current length.
    78     // The data stored in the bus will remain undisturbed.
    79     void resizeSmaller(size_t newLength);
    8076
    8177    // Direct access to PCM sample data. Non-const accessor clears silent flag.
     
    123119
    124120private:
    125     size_t m_length { 0 };
    126 
    127121    float* m_rawPointer { nullptr };
    128122    std::unique_ptr<AudioFloatArray> m_memBuffer;
     123    size_t m_length { 0 };
    129124    bool m_silent { true };
    130125};
Note: See TracChangeset for help on using the changeset viewer.