Exemple #1
0
 public override void Close()
 {
     if (!_closed)
     {
         try
         {
             uint encodedSize = 0;
             if (_mInBufferPos > 0)
             {
                 if (Lame_encDll.EncodeChunk(_mHLameStream, _mInBuffer, 0, (uint)_mInBufferPos, _mOutBuffer, ref encodedSize) == Lame_encDll.BE_ERR_SUCCESSFUL)
                 {
                     if (encodedSize > 0)
                     {
                         base.Write(_mOutBuffer, 0, (int)encodedSize);
                     }
                 }
             }
             encodedSize = 0;
             if (Lame_encDll.beDeinitStream(_mHLameStream, _mOutBuffer, ref encodedSize) == Lame_encDll.BE_ERR_SUCCESSFUL)
             {
                 if (encodedSize > 0)
                 {
                     base.Write(_mOutBuffer, 0, (int)encodedSize);
                 }
             }
         }
         finally
         {
             Lame_encDll.beCloseStream(_mHLameStream);
         }
     }
     _closed = true;
     CloseStream();
 }
Exemple #2
0
 public override void Close()
 {
     if (!closed)
     {
         try
         {
             uint EncodedSize = 0;
             if (m_InBufferPos > 0)
             {
                 if (Lame_encDll.EncodeChunk(m_hLameStream, m_InBuffer, 0, (uint)m_InBufferPos, m_OutBuffer, ref EncodedSize) == Lame_encDll.BE_ERR_SUCCESSFUL)
                 {
                     if (EncodedSize > 0)
                     {
                         base.Write(m_OutBuffer, 0, (int)EncodedSize);
                     }
                 }
             }
             EncodedSize = 0;
             if (Lame_encDll.beDeinitStream(m_hLameStream, m_OutBuffer, ref EncodedSize) == Lame_encDll.BE_ERR_SUCCESSFUL)
             {
                 if (EncodedSize > 0)
                 {
                     base.Write(m_OutBuffer, 0, (int)EncodedSize);
                 }
             }
         }
         finally
         {
             Lame_encDll.beCloseStream(m_hLameStream);
         }
     }
     closed = true;
     CloseStream();
 }