diff options
author | scop <scop> | 2005-08-27 08:59:00 +0000 |
---|---|---|
committer | scop <scop> | 2005-08-27 08:59:00 +0000 |
commit | 201bdb4a7b8de9fb03fbe3304b2b572d8db2790f (patch) | |
tree | 1107815c5571d3736f908a40e584542ad9599905 | |
parent | 836657232b829fc99c3b080c525009d6f668c2c6 (diff) | |
download | vdr-plugin-dxr3-201bdb4a7b8de9fb03fbe3304b2b572d8db2790f.tar.gz vdr-plugin-dxr3-201bdb4a7b8de9fb03fbe3304b2b572d8db2790f.tar.bz2 |
Fix crash on audio sync buffer push timeouts (Jon Burgess).
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | dxr3audiodecoder.c | 16 |
2 files changed, 12 insertions, 5 deletions
@@ -301,3 +301,4 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - use dxr3 hardware dvd playback functions in spudecoder (Christian Gmeiner) - don't abort with lpcm frames containing an odd number of bytes, drop the frame instead (Ville Skyttä) +- fix crash on audio sync buffer push timeouts (Jon Burgess) diff --git a/dxr3audiodecoder.c b/dxr3audiodecoder.c index f742375..20345bd 100644 --- a/dxr3audiodecoder.c +++ b/dxr3audiodecoder.c @@ -166,8 +166,12 @@ void cDxr3AudioDecoder::Decode(const uint8_t* buf, int length, uint32_t pts, { cFixedLengthFrame* pTempFrame = aBuf.Push(pcmbuf, out_size, pts); - pTempFrame->SetChannelCount(channels); - pTempFrame->SetDataRate(rate); + if (pTempFrame) + { + // TODO: should we break out of the loop on push timeout? + pTempFrame->SetChannelCount(channels); + pTempFrame->SetDataRate(rate); + } } length -= len; buf += len; @@ -241,9 +245,11 @@ void cDxr3AudioDecoder::DecodeLpcm(const uint8_t* buf, int length, cFixedLengthFrame* pTempFrame = aBuf.Push(pFrame, length - LPCM_HEADER_LENGTH, pts); - pTempFrame->SetChannelCount(1); - pTempFrame->SetDataRate(speed); - + if (pTempFrame) + { + pTempFrame->SetChannelCount(1); + pTempFrame->SetDataRate(speed); + } delete[] pFrame; } } |