Пример #1
0
// CheckAddressForDup - check audio, video and text addresses, unless the
// stream matches.
bool CheckAddressForDup (CMediaStreamList *stream_list, 
			 CMediaStream *s,
			 config_index_t profile_ix, 
			 config_index_t addr_ix, 
			 config_index_t port_ix)

{
  CMediaStream *p = stream_list->GetHead();

  while (p != NULL) {
    if (p != s) {
      if (CheckDup(s, p,
		   profile_ix, addr_ix, port_ix, 
		   STREAM_VIDEO_PROFILE, STREAM_VIDEO_DEST_ADDR, STREAM_VIDEO_DEST_PORT)) {
	return true;
      }
      if (CheckDup(s, p,
		   profile_ix, addr_ix, port_ix, 
		   STREAM_AUDIO_PROFILE, STREAM_AUDIO_DEST_ADDR, STREAM_AUDIO_DEST_PORT)) {
	return true;
      }
      if (CheckDup(s, p,
		   profile_ix, addr_ix, port_ix, 
		   STREAM_TEXT_PROFILE, STREAM_TEXT_DEST_ADDR, STREAM_TEXT_DEST_PORT)) {
	return true;
      }
    }
    p = p->GetNext();
  }
  return false;
}
Пример #2
0
void Alloc()
{
    char name[MAX_BUF];
    Next();
    if (Token != 'x') {
        Expected("Variable Name");
    }
    CheckDup(Value);

    sprintf(name, Value);
    AddEntry(name, 'v');
    Next();
    if (Token == '=') {
        Next();
        if (Token != '#') {
            Expected("Integer");
        }
        Allocate(name, Value);
        Next();
    } else {
        Allocate(name, "0");
    }
}