Logo Search packages:      
Sourcecode: blender version File versions  Download package

int av_get_packet ( ByteIOContext *  s,
AVPacket *  pkt,
int  size 
)

Allocate and read the payload of a packet and intialized its fields to default values.

Parameters:
pkt packet
size wanted payload size
Returns:
>0 (read size) if OK. AVERROR_xxx otherwise.

Definition at line 216 of file utils.c.

References av_new_packet().

{
    int ret= av_new_packet(pkt, size);

    if(ret<0)
        return ret;

    pkt->pos= url_ftell(s);

    ret= get_buffer(s, pkt->data, size);
    if(ret<=0)
        av_free_packet(pkt);
    else
        pkt->size= ret;

    return ret;
}


Generated by  Doxygen 1.6.0   Back to index