diff options
author | wm4 <wm4@nowhere> | 2013-05-01 21:13:13 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-03 21:08:26 +0200 |
commit | 71cc8c1581214a556074b79b06144bfd49554285 (patch) | |
tree | 062a3dd2ba0d06b511197a8d888abc0d33f97d11 /video/filter | |
parent | f8c13d6b6622f0a06331cbb1cf66b3969fa3618c (diff) | |
download | mpv-71cc8c1581214a556074b79b06144bfd49554285.tar.bz2 mpv-71cc8c1581214a556074b79b06144bfd49554285.tar.xz |
vf_rotate: fix for some obscure pixel formats
Repurpose the 3 byte case for any unhandled pixel width. Fixes rotation
with e.g. rgb48. Very inefficient, but works.
Diffstat (limited to 'video/filter')
-rw-r--r-- | video/filter/vf_rotate.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/video/filter/vf_rotate.c b/video/filter/vf_rotate.c index 9cdbafd94d..09b3d09add 100644 --- a/video/filter/vf_rotate.c +++ b/video/filter/vf_rotate.c @@ -52,15 +52,14 @@ static void rotate(unsigned char* dst,unsigned char* src,int dststride,int srcst case 2: for(x=0;x<w;x++) *((short*)(dst+x*2))=*((short*)(src+y*2+x*srcstride)); break; - case 3: - for(x=0;x<w;x++){ - dst[x*3+0]=src[0+y*3+x*srcstride]; - dst[x*3+1]=src[1+y*3+x*srcstride]; - dst[x*3+2]=src[2+y*3+x*srcstride]; - } - break; case 4: for(x=0;x<w;x++) *((int*)(dst+x*4))=*((int*)(src+y*4+x*srcstride)); + default: + for(x=0;x<w;x++){ + for (int b=0;b<bpp;b++) + dst[x*bpp+b]=src[b+y*bpp+x*srcstride]; + } + break; } dst+=dststride; } |