[Opalvoip-svn] SF.net SVN: opalvoip:[33023] ptlib/trunk/src/ptclib/pwavfile.cxx
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2014-10-22 11:21:44
|
Revision: 33023 http://sourceforge.net/p/opalvoip/code/33023 Author: rjongbloed Date: 2014-10-22 11:21:36 +0000 (Wed, 22 Oct 2014) Log Message: ----------- Fixed incorrect deleting of WAV file format handler on file close. Only deleted if it changes or PWAVFile destroyed. Modified Paths: -------------- ptlib/trunk/src/ptclib/pwavfile.cxx Modified: ptlib/trunk/src/ptclib/pwavfile.cxx =================================================================== --- ptlib/trunk/src/ptclib/pwavfile.cxx 2014-10-21 15:50:53 UTC (rev 33022) +++ ptlib/trunk/src/ptclib/pwavfile.cxx 2014-10-22 11:21:36 UTC (rev 33023) @@ -117,7 +117,9 @@ PWAVFile::~PWAVFile() { - Close(); + Close(); + delete m_autoConverter; + delete m_formatHandler; } @@ -184,15 +186,6 @@ if (m_status == e_Writing) UpdateHeader(); - if (m_formatHandler != NULL) { - m_formatHandler->OnStop(); - delete m_formatHandler; - m_formatHandler = NULL; - } - - delete m_autoConverter; - m_autoConverter = NULL; - return PFile::Close(); } @@ -501,14 +494,6 @@ } -// Generates the wave file header. -// Two types of header are supported. -// a) PCM data, set to 8000Hz, mono, 16-bit samples -// b) G.723.1 data -// When this function is called with lenData < 0, it will write the header -// as if the lenData is LONG_MAX minus header length. -// Note: If it returns false, the file may be left in inconsistent state. - bool PWAVFile::GenerateHeader() { if (m_formatHandler == NULL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |