Changeset 20e0dd7eb7c2e6debe9f5546784a422033e5d1bb

Show
Ignore:
Timestamp:
28/08/08 21:23:26 (3 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1219951406 +0200
git-parent:

[24ed0b35086f2435f61c78ea712c0af801537c73]

git-author:
Laurent Aimar <fenrir@videolan.org> 1219951406 +0200
Message:

Fixed(woraround) another bug of swscaler when ask to do a nop.

If we ask to convert but this conversion does nothing (same chroma and
same width/height, swscaler does not copy the pixels.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/video_filter/swscale.c

    rfb7f014 r20e0dd7  
    9898    picture_t *p_dst_e; 
    9999    bool b_add_a; 
     100    bool b_copy; 
    100101}; 
    101102 
     
    111112    bool b_add_a; 
    112113    int  i_sws_flags; 
     114    bool b_copy; 
    113115} ScalerConfiguration; 
    114116 
     
    307309        p_cfg->b_has_a = b_has_ai && b_has_ao; 
    308310        p_cfg->b_add_a = (!b_has_ai) && b_has_ao; 
     311        p_cfg->b_copy = i_fmti == i_fmto && p_fmti->i_width == p_fmto->i_width && p_fmti->i_width && p_fmto->i_height; 
    309312        p_cfg->i_sws_flags = i_sws_flags; 
    310313    } 
     
    389392 
    390393    p_sys->b_add_a = cfg.b_add_a; 
     394    p_sys->b_copy = cfg.b_copy; 
    391395    p_sys->fmt_in  = *p_fmti; 
    392396    p_sys->fmt_out = *p_fmto; 
     
    543547    } 
    544548 
    545     Convert( p_sys->ctx, p_dst, p_src, p_fmti->i_height, 0, 3 ); 
     549    if( p_sys->b_copy ) 
     550        picture_CopyPixels( p_dst, p_src ); 
     551    else 
     552        Convert( p_sys->ctx, p_dst, p_src, p_fmti->i_height, 0, 3 ); 
    546553    if( p_sys->ctxA ) 
    547554    {