static int asf_read_marker(AVFormatContext *s, int64_t size)

{

    AVIOContext *pb = s->pb;

    ASFContext *asf = s->priv_data;

    int i, count, name_len, ret;

    char name[1024];



    avio_rl64(pb);            // reserved 16 bytes

    avio_rl64(pb);            // ...

    count = avio_rl32(pb);    // markers count

    avio_rl16(pb);            // reserved 2 bytes

    name_len = avio_rl16(pb); // name length

    for (i = 0; i < name_len; i++)

        avio_r8(pb); // skip the name



    for (i = 0; i < count; i++) {

        int64_t pres_time;

        int name_len;



        avio_rl64(pb);             // offset, 8 bytes

        pres_time = avio_rl64(pb); // presentation time

        pres_time -= asf->hdr.preroll * 10000;

        avio_rl16(pb);             // entry length

        avio_rl32(pb);             // send time

        avio_rl32(pb);             // flags

        name_len = avio_rl32(pb);  // name length

        if ((ret = avio_get_str16le(pb, name_len * 2, name,

                                    sizeof(name))) < name_len)

            avio_skip(pb, name_len - ret);

        avpriv_new_chapter(s, i, (AVRational) { 1, 10000000 }, pres_time,

                           AV_NOPTS_VALUE, name);

    }



    return 0;

}

static int asf_read_marker(AVFormatContext *s, int64_t size)

{

    AVIOContext *pb = s->pb;

    ASFContext *asf = s->priv_data;

    int i, count, name_len, ret;

    char name[1024];



    avio_rl64(pb);            

    avio_rl64(pb);            

    count = avio_rl32(pb);    

    avio_rl16(pb);            

    name_len = avio_rl16(pb); 

    for (i = 0; i < name_len; i++)

        avio_r8(pb); 



    for (i = 0; i < count; i++) {

        int64_t pres_time;

        int name_len;



        avio_rl64(pb);             

        pres_time = avio_rl64(pb); 

        pres_time -= asf->hdr.preroll * 10000;

        avio_rl16(pb);             

        avio_rl32(pb);             

        avio_rl32(pb);             

        name_len = avio_rl32(pb);  

        if ((ret = avio_get_str16le(pb, name_len * 2, name,

                                    sizeof(name))) < name_len)

            avio_skip(pb, name_len - ret);

        avpriv_new_chapter(s, i, (AVRational) { 1, 10000000 }, pres_time,

                           AV_NOPTS_VALUE, name);

    }



    return 0;

}

    for (i = 0; i < name_len; i++)
static int FUNC_0(AVFormatContext *VAR_0, int64_t VAR_1)

{

    AVIOContext *pb = VAR_0->pb;

    ASFContext *asf = VAR_0->priv_data;

    int VAR_2, VAR_3, VAR_7, VAR_5;

    char VAR_6[1024];



    avio_rl64(pb);            

    avio_rl64(pb);            

    VAR_3 = avio_rl32(pb);    

    avio_rl16(pb);            

    VAR_7 = avio_rl16(pb); 

    for (VAR_2 = 0; VAR_2 < VAR_7; VAR_2++)

        avio_r8(pb); 



    for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) {

        int64_t pres_time;

        int VAR_7;



        avio_rl64(pb);             

        pres_time = avio_rl64(pb); 

        pres_time -= asf->hdr.preroll * 10000;

        avio_rl16(pb);             

        avio_rl32(pb);             

        avio_rl32(pb);             

        VAR_7 = avio_rl32(pb);  

        if ((VAR_5 = avio_get_str16le(pb, VAR_7 * 2, VAR_6,

                                    sizeof(VAR_6))) < VAR_7)

            avio_skip(pb, VAR_7 - VAR_5);

        avpriv_new_chapter(VAR_0, VAR_2, (AVRational) { 1, 10000000 }, pres_time,

                           AV_NOPTS_VALUE, VAR_6);

    }



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, int64_t VAR_1)
{ AVIOContext *pb = VAR_0->pb; ASFContext *asf = VAR_0->priv_data; int VAR_2, VAR_3, VAR_7, VAR_5; char VAR_6[1024]; avio_rl64(pb); avio_rl64(pb); VAR_3 = avio_rl32(pb); avio_rl16(pb); VAR_7 = avio_rl16(pb); for (VAR_2 = 0; VAR_2 < VAR_7; VAR_2++) avio_r8(pb); for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) { int64_t pres_time; int VAR_7; avio_rl64(pb); pres_time = avio_rl64(pb); pres_time -= asf->hdr.preroll * 10000; avio_rl16(pb); avio_rl32(pb); avio_rl32(pb); VAR_7 = avio_rl32(pb); if ((VAR_5 = avio_get_str16le(pb, VAR_7 * 2, VAR_6,
sizeof(VAR_6))) < VAR_7)
avio_skip(pb, VAR_7 - VAR_5); avpriv_new_chapter(VAR_0, VAR_2, (AVRational) { 1, 10000000 }, pres_time, AV_NOPTS_VALUE, VAR_6); } return 0; }