<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
font-size:10.5pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi everyone:<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>I tested the libdvbpsi v1.0.0 pre2 in my project today, I found there is a problem when libdvbpsi handles a table which split into multi-sections.<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>My network is a DVB network, and there is a NIT split into two sections(the last section number is 1). In the test, I found only the information in the last section of NIT had been handled in the most conditions, the sec0’s data couldn’t be handled correctly. After read libdvbpsi’s source code, I found this function: dvbpsi_decoder_psi_sections_completed verifies if a table’s sections have been gathered completely. But I think this condition(p_decoder->i_last_section_number == p->i_number) is not perfect, because if the first section I received is last section of table, this condition will be true and will active the callback I registered. So I change the function implement to the following:<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>bool dvbpsi_decoder_psi_sections_completed(dvbpsi_decoder_t* p_decoder)<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>{<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> assert(p_decoder);<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> assert(p_decoder->i_last_section_number <= 255);<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> bool b_complete = true;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>/* dvbpsi_psi_section_t *p = p_decoder->p_sections;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>* while (p)<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>* {<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>* if (p_decoder->i_last_section_number == p->i_number)<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>* b_complete = true;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>* p = p->p_next;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>* }<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>*/<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> int i;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> for(i = 0; i <= p_decoder->i_last_section_number; i ++)<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> {<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> dvbpsi_psi_section_t * p = p_decoder->p_sections;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> while(p)<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> {<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> if(i == p->i_number)<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> break;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> p = p->p_next;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> if(p == NULL)<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> b_complete = false;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US> return b_complete;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>}<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>After recompile, the libdvbpsi can handle my NIT correctly. <o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>I’m a newer of libdvbpsi, I don’t want change any code of it, so can anyone tell me this is a bug or I misunderstand something?<o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>Fred from China. <o:p></o:p></span></p></div></body></html>