2010-10-07, 21:46
I'm working on a Slingbox player for XBMC and I got almost everything working for the most part, just stuck on one piece (so far ). It's to do with channel changes. The code I'm talking about is this (from CDVDPlayer::HandleMessages()):
What is the purpose of deleting the m_pDemuxer if the channel change is successfull? I get the point of flushing the buffers, but why delete the demuxer? The issue I'm running into is that if I remove that SAFE_DELETE line, channel changes work just fine, but if I leave it in XBMC stops playing the stream.
Any insight into this is much appreciated.
Thanks,
Harry
Code:
else if (pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_NEXT) ||
pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_PREV) ||
(pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_SELECT) && m_messenger.GetPacketCount(CDVDMsg::PLAYER_CHANNEL_SELECT) == 0))
{
CDVDInputStream::IChannel* input = dynamic_cast<CDVDInputStream::IChannel*>(m_pInputStream);
if(input)
{
g_infoManager.SetDisplayAfterSeek(100000);
bool result;
if (pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_SELECT))
result = input->SelectChannel(static_cast<CDVDMsgInt*>(pMsg)->m_value);
else if(pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_NEXT))
result = input->NextChannel();
else
result = input->PrevChannel();
if(result)
{
FlushBuffers(false);
SAFE_DELETE(m_pDemuxer);
}
g_infoManager.SetDisplayAfterSeek();
}
}
What is the purpose of deleting the m_pDemuxer if the channel change is successfull? I get the point of flushing the buffers, but why delete the demuxer? The issue I'm running into is that if I remove that SAFE_DELETE line, channel changes work just fine, but if I leave it in XBMC stops playing the stream.
Any insight into this is much appreciated.
Thanks,
Harry