diff options
author | Joakim Plate <elupus@ecce.se> | 2012-09-02 10:21:02 +0200 |
---|---|---|
committer | Joakim Plate <elupus@ecce.se> | 2012-09-02 10:27:14 +0200 |
commit | 399bc7db799f72431e37a8b00bbda157dee8eea7 (patch) | |
tree | 0c6e8528bbb60e183078086a4d04e2508ffb8acf | |
parent | 640fce7356a90dd1ad5936acff51bbbced141736 (diff) |
dvdplayer: Make sure packet status is self contained with constructor and destructor
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayerAudio.h | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp index 90f0784b87..3cd44c0e10 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp @@ -184,7 +184,6 @@ CDVDPlayerAudio::CDVDPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent) m_freq = CurrentHostFrequency(); - m_decode.msg = NULL; m_messageQueue.SetMaxDataSize(6 * 1024 * 1024); m_messageQueue.SetMaxTimeSize(8.0); g_dvdPerformanceCounter.EnableAudioQueue(&m_messageQueue); @@ -545,7 +544,6 @@ int CDVDPlayerAudio::DecodeFrame(DVDAudioFrame &audioframe, bool bDropPacket) void CDVDPlayerAudio::OnStartup() { - m_decode.msg = NULL; m_decode.Release(); g_dvdPerformanceCounter.EnableAudioDecodePerformance(this); diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.h b/xbmc/cores/dvdplayer/DVDPlayerAudio.h index 988d171c6b..cc6e4cbf72 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerAudio.h +++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.h @@ -150,8 +150,19 @@ protected: double m_audioClock; // data for audio decoding - struct + struct PacktetStatus { + PacktetStatus() + { + msg = NULL; + Release(); + } + + ~PacktetStatus() + { + Release(); + } + CDVDMsgDemuxerPacket* msg; BYTE* data; int size; @@ -159,6 +170,7 @@ protected: void Attach(CDVDMsgDemuxerPacket* msg2) { + if(msg) msg->Release(); msg = msg2; msg->Acquire(); DemuxPacket* p = msg->GetPacket(); |