<commit_before>//  
// Copyright (C) 2007 SIPez LLC. 
// Licensed to SIPfoundry under a Contributor Agreement. 
//
// Copyright (C) 2007 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// $$
///////////////////////////////////////////////////////////////////////////////

// Author: <NAME> <<EMAIL> SIP<EMAIL>>

// SYSTEM INCLUDES
#include <assert.h>

// APPLICATION INCLUDES
#include <mp/MpBuf.h>
#include <mp/MprAudioFrameBuffer.h>

// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STATIC VARIABLE INITIALIZATIONS

/* //////////////////////////// PUBLIC //////////////////////////////////// */

/* ============================ CREATORS ================================== */

// Constructor
MprAudioFrameBuffer::MprAudioFrameBuffer(const UtlString& rName, 
                 int samplesPerFrame, 
                 int samplesPerSec,
                 int numFramesOfHistory)
:  MpAudioResource(rName, 0, 1, 0, 1,
                   samplesPerFrame, samplesPerSec),
                   mFrameCount(0),
                   mNumBufferFrames(numFramesOfHistory),
                   mpBufferedFrameArray(NULL)

{
   mpBufferedFrameArray = new MpBufPtr[mNumBufferFrames];
}

// Destructor
MprAudioFrameBuffer::~MprAudioFrameBuffer()
{
   if(mpBufferedFrameArray)
   {
      delete mpBufferedFrameArray;
      mpBufferedFrameArray = NULL;
   }
}

/* ============================ MANIPULATORS ============================== */

/* ============================ ACCESSORS ================================= */

/* ============================ INQUIRY =================================== */

/* //////////////////////////// PROTECTED ///////////////////////////////// */<commit_msg>Fix bug in deletion of mpBufferedFrameArray -- delete with array delete.<commit_after>//  
// Copyright (C) 2007 SIPez LLC. 
// Licensed to SIPfoundry under a Contributor Agreement. 
//
// Copyright (C) 2007 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// $$
///////////////////////////////////////////////////////////////////////////////

// Author: <NAME> <<EMAIL> SIP<EMAIL>>

// SYSTEM INCLUDES
#include <assert.h>

// APPLICATION INCLUDES
#include <mp/MpBuf.h>
#include <mp/MprAudioFrameBuffer.h>

// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STATIC VARIABLE INITIALIZATIONS

/* //////////////////////////// PUBLIC //////////////////////////////////// */

/* ============================ CREATORS ================================== */

// Constructor
MprAudioFrameBuffer::MprAudioFrameBuffer(const UtlString& rName, 
                 int samplesPerFrame, 
                 int samplesPerSec,
                 int numFramesOfHistory)
:  MpAudioResource(rName, 0, 1, 0, 1,
                   samplesPerFrame, samplesPerSec),
                   mFrameCount(0),
                   mNumBufferFrames(numFramesOfHistory),
                   mpBufferedFrameArray(NULL)

{
   mpBufferedFrameArray = new MpBufPtr[mNumBufferFrames];
}

// Destructor
MprAudioFrameBuffer::~MprAudioFrameBuffer()
{
   if(mpBufferedFrameArray)
   {
      delete[] mpBufferedFrameArray;
      mpBufferedFrameArray = NULL;
   }
}

/* ============================ MANIPULATORS ============================== */

/* ============================ ACCESSORS ================================= */

/* ============================ INQUIRY =================================== */

/* //////////////////////////// PROTECTED ///////////////////////////////// */
{'fraction_non_alphanumeric': 0.34142815842729113, 'fraction_numerical': 0.007516623301532235, 'mean_word_length': 2.0350877192982457, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5618511', 'n_tokens_mistral': 969, 'n_tokens_neox': 885, 'n_words': 175}