Revision 765e94ef libavcodec/mpeg12.c

View differences:

libavcodec/mpeg12.c
1216 1216
            return PIX_FMT_VDPAU_MPEG2;
1217 1217
    }else{
1218 1218
        if(s->chroma_format <  2)
1219
            return PIX_FMT_YUV420P;
1219
            return avctx->get_format(avctx,ff_pixfmt_list_420);
1220 1220
        else if(s->chroma_format == 2)
1221 1221
            return PIX_FMT_YUV422P;
1222 1222
        else
......
1605 1605
    s->pblocks[5] = tmp;
1606 1606
}
1607 1607

  
1608
static int mpeg_field_start(MpegEncContext *s){
1608
static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size){
1609 1609
    AVCodecContext *avctx= s->avctx;
1610 1610
    Mpeg1Context *s1 = (Mpeg1Context*)s;
1611 1611

  
......
1645 1645
                }
1646 1646
            }
1647 1647
    }
1648

  
1649
    if (avctx->hwaccel) {
1650
        if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
1651
            return -1;
1652
    }
1653

  
1648 1654
// MPV_frame_start will call this function too,
1649 1655
// but we need to call it on every field
1650 1656
    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
......
2074 2080
    avctx->pix_fmt = mpeg_get_pixelformat(avctx);
2075 2081
    avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
2076 2082

  
2077
    if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT ||
2083
    if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT || avctx->hwaccel ||
2078 2084
        s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU )
2079 2085
        if( avctx->idct_algo == FF_IDCT_AUTO )
2080 2086
            avctx->idct_algo = FF_IDCT_SIMPLE;
......
2384 2390

  
2385 2391
                if(s2->first_slice){
2386 2392
                    s2->first_slice=0;
2387
                    if(mpeg_field_start(s2) < 0)
2393
                    if(mpeg_field_start(s2, buf, buf_size) < 0)
2388 2394
                        return -1;
2389 2395
                }
2390 2396
                if(!s2->current_picture_ptr){

Also available in: Unified diff