s->picture.interlaced_frame = 1; s->picture.bottom_field_first = 1;
static int dvvideo_decode_frame(AVCodecContext *avctx,                                  void *data, int *data_size,                                 uint8_t *buf, int buf_size){    DVVideoDecodeContext *s = avctx->priv_data;    int ds, vs;    const uint16_t *mb_pos_ptr;        s->sys = dv_frame_profile(buf);    if (!s->sys || buf_size < s->sys->frame_size)        return -1; /* NOTE: we only accept several full frames */	    if(s->picture.data[0])        avctx->release_buffer(avctx, &s->picture);        s->picture.reference = 0;    avctx->pix_fmt = s->sys->pix_fmt;    avctx->width = s->sys->width;    avctx->height = s->sys->height;    if(avctx->get_buffer(avctx, &s->picture) < 0) {        fprintf(stderr, "get_buffer() failed\n");        return -1;    }    /* for each DIF segment */    mb_pos_ptr = s->sys->video_place;    for (ds = 0; ds < s->sys->difseg_size; ds++) {        buf += 6 * 80; /* skip DIF segment header */                for(vs = 0; vs < 27; vs++) {            if ((vs % 3) == 0)	        buf += 80; /* skip audio block */            #ifdef VLC_DEBUG            printf("********************* %d, %d **********************\n", ds, vs);#endif	    dv_decode_video_segment(s, buf, mb_pos_ptr);            buf += 5 * 80;            mb_pos_ptr += 5;        }    }    emms_c();    /* return image */    *data_size = sizeof(AVFrame);    *(AVFrame*)data= s->picture;        return s->sys->frame_size;}