fixed crash when switching streams

This commit is contained in:
badaix 2016-02-06 12:51:20 +01:00
parent 060e52aeee
commit 3a5af32d98
5 changed files with 14 additions and 2 deletions

View file

@ -39,6 +39,7 @@ OggDecoder::OggDecoder() : Decoder(), buffer(NULL), bytes(0)
OggDecoder::~OggDecoder()
{
std::lock_guard<std::mutex> lock(mutex_);
free(convbuffer);
vorbis_block_clear(&vb);
vorbis_dsp_clear(&vd);
@ -51,7 +52,7 @@ OggDecoder::~OggDecoder()
bool OggDecoder::decode(msg::PcmChunk* chunk)
{
std::lock_guard<std::mutex> lock(mutex_);
/* grab some data at the head of the stream. We want the first page
(which is guaranteed to be small and only contain the Vorbis
stream initial header) We need the first page to get the stream