<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">Hi, my name is Angelo Schiavone and I'm a developer working </span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">on a dvb transport stream analyzer which uses libdvbpsi version 1.0.0 library.</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">First of all thanks a lot for sharing your efforts.</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">I've noticed that there are 2 bugs in decoding BAT and NIT </span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">tables, according to ETSI EN 300 468 standard, which makes tables decoding wrong.</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">In BAT.c file ->  "dvbpsi_bat_sections_decode" function is :</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span>dvbpsi_bat_sections_decode(dvbpsi_bat_t*<span style="color:rgb(192,192,192)"> </span>p_bat,</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                              </span><span style="color:rgb(128,0,128)">dvbpsi_psi_section_t</span>*<span style="color:rgb(192,192,192)"> </span>p_section)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">  </span>uint8_t*<span style="color:rgb(192,192,192)"> </span>p_byte,<span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span>p_end,<span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span>p_end2;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">while</span>(p_section)</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">  </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">first</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">loop</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">descriptors</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>p_byte<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_start<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)"> </span>((uint16_t)(p_section->p_payload_start[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                       </span>|<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_start[<span style="color:rgb(0,0,128)">1</span>]);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">while</span>(p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">      </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_tag<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">0</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,128,0)">if</span>(i_length<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span>p_byte)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>dvbpsi_bat_bouquet_descriptor_add(p_bat,<span style="color:rgb(192,192,192)"> </span>i_tag,<span style="color:rgb(192,192,192)"> </span>i_length,<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_length;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192);background-color:rgb(51,255,51)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)"> </span>((uint16_t)(p_byte[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                       </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>]);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">if</span>(p_end<span style="color:rgb(192,192,192)"> </span>><span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">        </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end;</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">TSs</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">for</span>(;<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">6</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end;)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">      </span><span style="background-color:rgb(51,255,51)">p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>;</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">      </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_ts_id<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)p_byte[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_orig_network_id<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)p_byte[<span style="color:rgb(0,0,128)">2</span>]<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">3</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_transport_descriptors_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)(p_byte[<span style="color:rgb(0,0,128)">4</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">5</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>dvbpsi_bat_ts_t*<span style="color:rgb(192,192,192)"> </span>p_ts<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>dvbpsi_bat_ts_add(p_bat,<span style="color:rgb(192,192,192)"> </span>i_ts_id,<span style="color:rgb(192,192,192)"> </span>i_orig_network_id);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">TS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">descriptors</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">6</span>;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>p_end2<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_transport_descriptors_length;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,128,0)">if</span>(<span style="color:rgb(192,192,192)"> </span>p_end2<span style="color:rgb(192,192,192)"> </span>><span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end<span style="color:rgb(192,192,192)"> </span>)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">            </span>p_end2<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end;</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">      </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,128,0)">while</span>(p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end2)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">        </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_tag<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">0</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">if</span>(i_length<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end2<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span>p_byte)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">          </span>dvbpsi_bat_ts_descriptor_add(p_ts,<span style="color:rgb(192,192,192)"> </span>i_tag,<span style="color:rgb(192,192,192)"> </span>i_length,<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_length;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span>p_section<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_next;</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">  </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">}</pre><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)"><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">while it should be:</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)"><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span>dvbpsi_bat_sections_decode(<span style="color:rgb(128,0,128)">dvbpsi_bat_t</span>*<span style="color:rgb(192,192,192)"> </span>p_bat,</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                              </span><span style="color:rgb(128,0,128)">dvbpsi_psi_section_t</span>*<span style="color:rgb(192,192,192)"> </span>p_section)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">  </span>uint8_t*<span style="color:rgb(192,192,192)"> </span>p_byte,<span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span>p_end,<span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span>p_end2;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">while</span>(p_section)</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">  </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">first</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">loop</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">descriptors</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>p_byte<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_start<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)"> </span>((uint16_t)(p_section->p_payload_start[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                       </span>|<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_start[<span style="color:rgb(0,0,128)">1</span>]);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">while</span>(p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">      </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_tag<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">0</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,128,0)">if</span>(i_length<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span>p_byte)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>dvbpsi_bat_bouquet_descriptor_add(p_bat,<span style="color:rgb(192,192,192)"> </span>i_tag,<span style="color:rgb(192,192,192)"> </span>i_length,<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_length;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> <span style="background-color:rgb(51,255,51)"> </span></span><span style="background-color:rgb(51,255,51)"><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span>+</span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)"> </span>((uint16_t)(p_byte[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                       </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>]);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">if</span>(p_end<span style="color:rgb(192,192,192)"> </span>><span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">        </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end;</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="background-color:rgb(51,255,51)">    p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>;</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">TSs</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">for</span>(;<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">6</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end;)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">      </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_ts_id<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)p_byte[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_orig_network_id<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)p_byte[<span style="color:rgb(0,0,128)">2</span>]<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">3</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_transport_descriptors_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)(p_byte[<span style="color:rgb(0,0,128)">4</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">5</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,0,128)">dvbpsi_bat_ts_t</span>*<span style="color:rgb(192,192,192)"> </span>p_ts<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>dvbpsi_bat_ts_add(p_bat,<span style="color:rgb(192,192,192)"> </span>i_ts_id,<span style="color:rgb(192,192,192)"> </span>i_orig_network_id);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">TS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">descriptors</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">6</span>;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>p_end2<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_transport_descriptors_length;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,128,0)">if</span>(<span style="color:rgb(192,192,192)"> </span>p_end2<span style="color:rgb(192,192,192)"> </span>><span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end<span style="color:rgb(192,192,192)"> </span>)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">            </span>p_end2<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end;</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">      </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,128,0)">while</span>(p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end2)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">        </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_tag<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">0</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">if</span>(i_length<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end2<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span>p_byte)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">          </span>dvbpsi_bat_ts_descriptor_add(p_ts,<span style="color:rgb(192,192,192)"> </span>i_tag,<span style="color:rgb(192,192,192)"> </span>i_length,<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_length;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">      </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span>p_section<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_next;</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">  </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">}</pre><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">In NIT.c file ->  "dvbpsi_nit_sections_decode" function is :</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
<br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)"><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span>dvbpsi_nit_sections_decode(<span style="color:rgb(128,0,128)">dvbpsi_nit_t</span>*<span style="color:rgb(192,192,192)"> </span>p_nit,</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(128,0,128)">dvbpsi_psi_section_t</span>*<span style="color:rgb(192,192,192)"> </span>p_section)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span>uint8_t*<span style="color:rgb(192,192,192)"> </span>p_byte,<span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span>p_end,<span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span>p_end2;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">while</span><span style="color:rgb(192,192,192)"> </span>(p_section)</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">    </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">NIT</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">descriptors</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>p_byte<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_start<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)">   </span>((uint16_t)(p_section->p_payload_start[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                           </span>|<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_start[<span style="color:rgb(0,0,128)">1</span>]);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">while</span><span style="color:rgb(192,192,192)"> </span>(p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">            </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_tag<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">0</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(i_length<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span>p_byte)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                </span>dvbpsi_nit_descriptor_add(p_nit,<span style="color:rgb(192,192,192)"> </span>i_tag,<span style="color:rgb(192,192,192)"> </span>i_length,<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_length;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192);background-color:rgb(51,255,51)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)">   </span>((uint16_t)(p_byte[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                       </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>]);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(p_end<span style="color:rgb(192,192,192)"> </span>><span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">            </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end;</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">        </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">TSs</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">for</span><span style="color:rgb(192,192,192)"> </span>(;<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">6</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end;)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">            </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_ts_id<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)p_byte[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_orig_network_id<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)p_byte[<span style="color:rgb(0,0,128)">2</span>]<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">3</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_ts_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)(p_byte[<span style="color:rgb(0,0,128)">4</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">5</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,128)">dvbpsi_nit_ts_t</span>*<span style="color:rgb(192,192,192)"> </span>p_ts<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>dvbpsi_nit_ts_add(p_nit,<span style="color:rgb(192,192,192)"> </span>i_ts_id,<span style="color:rgb(192,192,192)"> </span>i_orig_network_id);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">TS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">descriptors</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">6</span>;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span>p_end2<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_ts_length;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)"> </span>p_end2<span style="color:rgb(192,192,192)"> </span>><span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end<span style="color:rgb(192,192,192)"> </span>)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">                </span>p_end2<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end;</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">            </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">while</span><span style="color:rgb(192,192,192)"> </span>(p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end2)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span>{</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">                </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_tag<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">0</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(i_length<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end2<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span>p_byte)</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                    </span>dvbpsi_nit_ts_descriptor_add(p_ts,<span style="color:rgb(192,192,192)"> </span>i_tag,<span style="color:rgb(192,192,192)"> </span>i_length,<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>);</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">                </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_length;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">            </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<span style="color:rgb(192,192,192)">        </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">        </span>p_section<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_next;</pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><span style="color:rgb(192,192,192)">    </span>}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
}</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><br></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<font face="arial"><span style="white-space:normal">while it should be:</span></font></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px">
<span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span>dvbpsi_nit_sections_decode(<span style="color:rgb(128,0,128)">dvbpsi_nit_t</span>*<span style="color:rgb(192,192,192)"> </span>p_nit,</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(128,0,128)">dvbpsi_psi_section_t</span>*<span style="color:rgb(192,192,192)"> </span>p_section)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px">{</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>uint8_t*<span style="color:rgb(192,192,192)"> </span>p_byte,<span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span>p_end,<span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span>p_end2;</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">while</span><span style="color:rgb(192,192,192)"> </span>(p_section)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>{</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">NIT</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">descriptors</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>p_byte<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_start<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>;</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)">   </span>((uint16_t)(p_section->p_payload_start[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                           </span>|<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_start[<span style="color:rgb(0,0,128)">1</span>]);</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">while</span><span style="color:rgb(192,192,192)"> </span>(p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>{</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_tag<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">0</span>];</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(i_length<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span>p_byte)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span>dvbpsi_nit_descriptor_add(p_nit,<span style="color:rgb(192,192,192)"> </span>i_tag,<span style="color:rgb(192,192,192)"> </span>i_length,<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>);</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_length;</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>}</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px">
<span style="color:rgb(192,192,192)">        </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="background-color:rgb(51,255,51)"><span style="color:rgb(0,0,128)">2</span>+</span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)">   </span>((uint16_t)(p_byte[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                       </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>]);</pre>

<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(p_end<span style="color:rgb(192,192,192)"> </span>><span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>{</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end;</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>}</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>;</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">TSs</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">for</span><span style="color:rgb(192,192,192)"> </span>(;<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">6</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end;)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>{</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_ts_id<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)p_byte[<span style="color:rgb(0,0,128)">0</span>]<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_orig_network_id<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)p_byte[<span style="color:rgb(0,0,128)">2</span>]<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">3</span>];</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>uint16_t<span style="color:rgb(192,192,192)"> </span>i_ts_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>((uint16_t)(p_byte[<span style="color:rgb(0,0,128)">4</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)<span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">5</span>];</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,128)">dvbpsi_nit_ts_t</span>*<span style="color:rgb(192,192,192)"> </span>p_ts<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>dvbpsi_nit_ts_add(p_nit,<span style="color:rgb(192,192,192)"> </span>i_ts_id,<span style="color:rgb(192,192,192)"> </span>i_orig_network_id);</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">TS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">descriptors</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">6</span>;</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>p_end2<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_ts_length;</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)"> </span>p_end2<span style="color:rgb(192,192,192)"> </span>><span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end<span style="color:rgb(192,192,192)"> </span>)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>{</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span>p_end2<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_end;</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>}</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">while</span><span style="color:rgb(192,192,192)"> </span>(p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end2)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>{</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_tag<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">0</span>];</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span>uint8_t<span style="color:rgb(192,192,192)"> </span>i_length<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte[<span style="color:rgb(0,0,128)">1</span>];</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(i_length<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span><=<span style="color:rgb(192,192,192)"> </span>p_end2<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span>p_byte)</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                    </span>dvbpsi_nit_ts_descriptor_add(p_ts,<span style="color:rgb(192,192,192)"> </span>i_tag,<span style="color:rgb(192,192,192)"> </span>i_length,<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span>);</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>i_length;</pre>


<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>}</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>}</pre>

<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>p_section<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_section->p_next;</pre>

<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>}</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px">}</pre></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px">
<font face="arial"><span style="white-space:normal"><br></span></font></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255);margin-bottom:0px;margin-top:0px"><font face="arial"><span style="white-space:normal">I highlighted in green the diff.</span></font></pre>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">I discovered them when trying to decode a transort stream with a NIT and a BAT with 2 TS in the loop, if the second TS in the TS loop does not contain descriptors it wont be decoded/seen by libdvbpsi without this patch</div>