change libOggFLAC++ API to make OggFLAC::Decoder::Stream and OggFLAC::Encoder::Stream inherit from their FLAC counterparts

This commit is contained in:
Josh Coalson
2006-09-15 15:40:57 +00:00
parent edf672ed84
commit 68acb04a4d
13 changed files with 272 additions and 394 deletions

View File

@@ -45,8 +45,18 @@ namespace FLAC {
encoder_(::FLAC__stream_encoder_new())
{ }
Stream::Stream(::FLAC__StreamEncoder *encoder):
encoder_(encoder)
{ }
Stream::~Stream()
{
// WATCHOUT: must check for NULL not only because
// ::FLAC__stream_encoder_new() might have failed in
// the constructor, but also because
// OggFLAC::Encoder::Stream deletes the encoder_ before
// we get to it here to make the C inheritance magic
// work.
if(0 != encoder_) {
::FLAC__stream_encoder_finish(encoder_);
::FLAC__stream_encoder_delete(encoder_);