• Anton Khirnov's avatar
    hwframe: Allow hwaccel frame allocators to align surface sizes · d14179e3
    Anton Khirnov authored
    Hardware accelerated decoding generally uses AVHWFramesContext for pool
    allocation of hardware surfaces. These are setup to allocate surfaces
    aligned to hardware and hwaccel API requirements. Due to the
    architecture, av_hwframe_get_buffer() will return AVFrames with
    the dimensions set to the aligned sizes.
    
    This causes some decoders (like hevc) return these aligned size as
    final frame size, instead of cropping them to the video's actual
    dimensions. To make sure this doesn't happen, crop the frame to the
    size the decoder expects when ff_get_buffer() is called.
    
    Merges Libav commit 3fdf50f9.
    Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
    d14179e3
decode.c 59.5 KB