Revision 3bb07d61 libavcodec/mpegvideo.c

View differences:

libavcodec/mpegvideo.c
2726 2726
 */
2727 2727
void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
2728 2728
    if (s->avctx->draw_horiz_band) {
2729
        AVFrame *src;
2729 2730
        uint8_t *src_ptr[3];
2730 2731
        int offset[4];
2732
        
2733
        if(s->picture_structure != PICT_FRAME){
2734
            h <<= 1;
2735
            y <<= 1;
2736
            if(s->first_field  && !(s->avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
2737
        }
2738

  
2731 2739
        h= FFMIN(h, s->height - y);
2732 2740

  
2741
        if(s->pict_type==B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER)) 
2742
            src= (AVFrame*)s->current_picture_ptr;
2743
        else if(s->last_picture_ptr)
2744
            src= (AVFrame*)s->last_picture_ptr;
2745
        else
2746
            return;
2747
            
2733 2748
        if(s->pict_type==B_TYPE && s->picture_structure == PICT_FRAME && s->out_format != FMT_H264){
2734 2749
            offset[0]=
2735 2750
            offset[1]=
......
2744 2759

  
2745 2760
        emms_c();
2746 2761

  
2747
        s->avctx->draw_horiz_band(s->avctx, (AVFrame*)s->current_picture_ptr, offset,
2748
                               y, s->width, h);
2762
        s->avctx->draw_horiz_band(s->avctx, src, offset,
2763
                                  y, s->picture_structure, h);
2749 2764
    }
2750 2765
}
2751 2766

  

Also available in: Unified diff