Is this a bug?(About multi-sections)
"jiangpengfei" <[email protected]>
| Newsgroups | gmane.comp.video.videolan.libdvbpsi.devel |
|---|---|
| Message-ID | <000c01cdd2bc$81a80810$84f81830$@com> |
Hi everyone:
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.
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:
bool dvbpsi_decoder_psi_sections_completed(dvbpsi_decoder_t* p_decoder)
{
assert(p_decoder);
assert(p_decoder->i_last_section_number <= 255);
bool b_complete = true;
/* dvbpsi_psi_section_t *p = p_decoder->p_sections;
* while (p)
* {
* if (p_decoder->i_last_section_number == p->i_number)
* b_complete = true;
* p = p->p_next;
* }
*/
int i;
for(i = 0; i <= p_decoder->i_last_section_number; i ++)
{
dvbpsi_psi_section_t * p = p_decoder->p_sections;
while(p)
{
if(i == p->i_number)
break;
p = p->p_next;
}
if(p == NULL)
b_complete = false;
}
return b_complete;
}
After recompile, the libdvbpsi can handle my NIT correctly.
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?
Fred from China.
_______________________________________________
libdvbpsi-devel mailing list
[email protected]
http://mailman.videolan.org/listinfo/libdvbpsi-devel