[libdvbpsi-devel] Is this a bug?(About multi-sections)

jiangpengfei jiangpengfei at orientview.com
Wed Dec 5 08:45:30 CET 2012


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. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/libdvbpsi-devel/attachments/20121205/9218bfc4/attachment.html>


More information about the libdvbpsi-devel mailing list