pkt->destruct = __destruct_pkt;
int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,                       uint8_t* buf, int buf_size){    int size, i;    const DVprofile* sys = dv_frame_profile(buf);       if (buf_size < 4 || buf_size < sys->frame_size)        return -1;   /* Broken frame, or not enough data */    /* Queueing audio packet */    /* FIXME: in case of no audio/bad audio we have to do something */    size = dv_extract_audio_info(c, buf);    c->audio_pkt[0].data = c->audio_pkt[1].data = NULL;    for (i=0; i<c->ach; i++) {       if (av_new_packet(&c->audio_pkt[i], size) < 0)           return AVERROR_NOMEM;       c->audio_pkt[i].stream_index = c->ast[i]->index;       c->audio_pkt[i].pts = c->abytes * 30000*8 / c->ast[i]->codec.bit_rate;       c->audio_pkt[i].flags |= PKT_FLAG_KEY;    }    dv_extract_audio(buf, c->audio_pkt[0].data, c->audio_pkt[1].data);    c->abytes += size;        /* Now it's time to return video packet */    size = dv_extract_video_info(c, buf);    av_init_packet(pkt);    pkt->destruct = __destruct_pkt;    pkt->data     = buf;    pkt->size     = size;     pkt->flags   |= PKT_FLAG_KEY;    pkt->stream_index = c->vst->id;    pkt->pts      = c->frames * sys->frame_rate_base * (30000/sys->frame_rate);        c->frames++;    return size;}