title: Parsing the Program Association Section of a Transport Stream
body: <p>I am trying to find the Type of PID (AUDIO,VIDEO,etc..), i have parsed the Header section of the Transport Stream and extracted the PIDS . By going through the Transport Stream Standard i got to know that i need to parse the PAT to get the this. The Program Association Section mentioned in the standard is the below. In the below section what does 'N' in the for loop actually mean, can anyone please help me out.(Refer Table 2-25 in standard)</p>
  
  <pre><code>program_association_section() {
    table_id
    section_syntax_indicator
    '0'
    reserved
    section_length
    transport_stream_id
    reserved
    version_number
    current_next_indicator
    section_number
    last_section_number
    for (i = 0; i &lt; N; i++) {
      program_number
      reserved
      if (program_number = = '0') {
        network_PID
      }
      else {
        program_map_PID
      }
    }
    CRC_32
  }
  </code></pre>