summaryrefslogtreecommitdiff
path: root/dxr3audiodecoder.c
diff options
context:
space:
mode:
authorscop <scop>2005-08-27 08:57:18 +0000
committerscop <scop>2005-08-27 08:57:18 +0000
commit1b92132c940735bce313ec3467d029ec7d84a9fd (patch)
tree0d07848e525e7c568597cc723982393ced197713 /dxr3audiodecoder.c
parent4a33fe954fa713be10b0efdecbecd4e1b1f9caa7 (diff)
downloadvdr-plugin-dxr3-1b92132c940735bce313ec3467d029ec7d84a9fd.tar.gz
vdr-plugin-dxr3-1b92132c940735bce313ec3467d029ec7d84a9fd.tar.bz2
Fix crash on audio sync buffer push timeouts (Jon Burgess).
Diffstat (limited to 'dxr3audiodecoder.c')
-rw-r--r--dxr3audiodecoder.c16
1 files changed, 11 insertions, 5 deletions
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;
}
}