ByteIOContext *pb = &s->pb;
static int nsv_read_packet(AVFormatContext *s, AVPacket *pkt){    NSVContext *nsv = s->priv_data;    ByteIOContext *pb = &s->pb;    int i, err = 0;    PRINT(("%s()\n", __FUNCTION__));        /* in case we don't already have something to eat ... */    if (nsv->ahead[0].data == NULL && nsv->ahead[1].data == NULL)        err = nsv_read_chunk(s, 0);    if (err < 0)        return err;        /* now pick one of the plates */    for (i = 0; i < 2; i++) {        if (nsv->ahead[i].data) {        	PRINT(("%s: using cached packet[%d]\n", __FUNCTION__, i));            /* avoid the cost of new_packet + memcpy(->data) */            memcpy(pkt, &nsv->ahead[i], sizeof(AVPacket));            nsv->ahead[i].data = NULL; /* we ate that one */            return pkt->size;        }    }        /* this restaurant is not approvisionned :^] */    return -1;}