Ejemplo n.º 1
0
bool cXVDRDemux::SwitchChannel(const PVR_CHANNEL &channelinfo)
{
  XBMC->Log(LOG_DEBUG, "changing to channel %d", channelinfo.iChannelNumber);

  cRequestPacket vrp;
  uint32_t rc = 0;
  if (vrp.init(XVDR_CHANNELSTREAM_OPEN) && vrp.add_U32(channelinfo.iUniqueId) && ReadSuccess(&vrp, rc))
  {
    m_channelinfo = channelinfo;
    m_Streams.iStreamCount  = 0;

    return !ConnectionLost();
  }

  switch (rc)
  {
    // active recording
    case XVDR_RET_RECRUNNING:
     XBMC->QueueNotification(QUEUE_INFO, XBMC->GetLocalizedString(30062));
      break;
    // all receivers busy
    case XVDR_RET_DATALOCKED:
      XBMC->QueueNotification(QUEUE_INFO, XBMC->GetLocalizedString(30063));
      break;
    // encrypted channel
    case XVDR_RET_ENCRYPTED:
      XBMC->QueueNotification(QUEUE_INFO, XBMC->GetLocalizedString(30066));
      break;
    // error on switching channel
    default:
    case XVDR_RET_ERROR:
      XBMC->QueueNotification(QUEUE_INFO, XBMC->GetLocalizedString(30064));
      break;
    // invalid channel
    case XVDR_RET_DATAINVALID:
      XBMC->QueueNotification(QUEUE_ERROR, XBMC->GetLocalizedString(30065), channelinfo.strChannelName);
      break;
  }

  XBMC->Log(LOG_ERROR, "%s - failed to set channel", __FUNCTION__);
  return true;
}
Ejemplo n.º 2
0
bool cXVDRSession::ReadSuccess(cRequestPacket* vrp) {
  uint32_t rc;
  return ReadSuccess(vrp, rc);
}