static int gen_check_bw(URLContext *s, RTMPContext *rt)

{

    RTMPPacket pkt;

    uint8_t *p;

    int ret;



    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,

                                     0, 21)) < 0)

        return ret;



    p = pkt.data;

    ff_amf_write_string(&p, "_checkbw");

    ff_amf_write_number(&p, ++rt->nb_invokes);

    ff_amf_write_null(&p);



    ret = ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size,

                               rt->prev_pkt[1]);

    ff_rtmp_packet_destroy(&pkt);



    return ret;

}

static int gen_check_bw(URLContext *s, RTMPContext *rt)

{

    RTMPPacket pkt;

    uint8_t *p;

    int ret;



    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,

                                     0, 21)) < 0)

        return ret;



    p = pkt.data;

    ff_amf_write_string(&p, "_checkbw");

    ff_amf_write_number(&p, ++rt->nb_invokes);

    ff_amf_write_null(&p);



    ret = ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size,

                               rt->prev_pkt[1]);

    ff_rtmp_packet_destroy(&pkt);



    return ret;

}

static int FUNC_0(URLContext *VAR_0, RTMPContext *VAR_1)

{

    RTMPPacket pkt;

    uint8_t *p;

    int VAR_2;



    if ((VAR_2 = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,

                                     0, 21)) < 0)

        return VAR_2;



    p = pkt.data;

    ff_amf_write_string(&p, "_checkbw");

    ff_amf_write_number(&p, ++VAR_1->nb_invokes);

    ff_amf_write_null(&p);



    VAR_2 = ff_rtmp_packet_write(VAR_1->stream, &pkt, VAR_1->chunk_size,

                               VAR_1->prev_pkt[1]);

    ff_rtmp_packet_destroy(&pkt);



    return VAR_2;

}

static int FUNC_0(URLContext *VAR_0, RTMPContext *VAR_1)
{ RTMPPacket pkt; uint8_t *p; int VAR_2; if ((VAR_2 = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
0, 21)) < 0)
return VAR_2; p = pkt.data; ff_amf_write_string(&p, "_checkbw"); ff_amf_write_number(&p, ++VAR_1->nb_invokes); ff_amf_write_null(&p); VAR_2 = ff_rtmp_packet_write(VAR_1->stream, &pkt, VAR_1->chunk_size,
VAR_1->prev_pkt[1]); ff_rtmp_packet_destroy(&pkt); return VAR_2; }