Question about Channel Change code
#1
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 Smile ). It's to do with channel changes. The code I'm talking about is this (from CDVDPlayer::HandleMessages()):


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
Reply
#2
It seems my issue is somehow related to the m_pInputStream->NextStream() function. My CSlingboxFile class doesn't have this function defined so by default it returns false. However, changing this to true, still doesn't get me the results I'm looking for. So I guess the next questions is, what is the purpose of the NextStream() function, what does it signal? That the next stream is available, can be played, was switched to, etc.?

Thanks,
Harry
Reply

Logout Mark Read Team Forum Stats Members Help
Question about Channel Change code0