Also pass alpha plane to swscale, avoids crashes when converting between

YUV with alpha and some other format supporting alpha.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30158 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-01-01 01:06:34 +00:00
parent 8afc25d710
commit c0cae7b327
1 changed files with 4 additions and 4 deletions

View File

@ -331,7 +331,7 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){
static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src[MP_MAX_PLANES], int src_stride[MP_MAX_PLANES],
int y, int h, uint8_t *dst[MP_MAX_PLANES], int dst_stride[MP_MAX_PLANES], int interlaced){
uint8_t *src2[MP_MAX_PLANES]={src[0], src[1], src[2]};
uint8_t *src2[MP_MAX_PLANES]={src[0], src[1], src[2], src[3]};
#if HAVE_BIGENDIAN
uint32_t pal2[256];
if (src[1] && !src[2]){
@ -344,9 +344,9 @@ static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src
if(interlaced){
int i;
uint8_t *dst2[MP_MAX_PLANES]={dst[0], dst[1], dst[2]};
int src_stride2[MP_MAX_PLANES]={2*src_stride[0], 2*src_stride[1], 2*src_stride[2]};
int dst_stride2[MP_MAX_PLANES]={2*dst_stride[0], 2*dst_stride[1], 2*dst_stride[2]};
uint8_t *dst2[MP_MAX_PLANES]={dst[0], dst[1], dst[2], dst[3]};
int src_stride2[MP_MAX_PLANES]={2*src_stride[0], 2*src_stride[1], 2*src_stride[2], 2*src_stride[3]};
int dst_stride2[MP_MAX_PLANES]={2*dst_stride[0], 2*dst_stride[1], 2*dst_stride[2], 2*dst_stride[3]};
sws_scale_ordered(sws1, src2, src_stride2, y>>1, h>>1, dst2, dst_stride2);
for(i=0; i<3; i++){