diff options
author | wm4 <wm4@nowhere> | 2012-10-21 17:08:54 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-24 21:56:34 +0200 |
commit | 4b4e4b56909a07f1738d75c0f3fc1739990adfc9 (patch) | |
tree | c48f1cc6606d0403330e13b007dbbeaaf7201f50 /libmpcodecs | |
parent | f80a32a8ebd1573f1578d707416b07880c1a08c1 (diff) | |
download | mpv-4b4e4b56909a07f1738d75c0f3fc1739990adfc9.tar.bz2 mpv-4b4e4b56909a07f1738d75c0f3fc1739990adfc9.tar.xz |
draw_bmp: fix for yuy2 format
mp_get_chroma_shift() modifies its argument even if it fails, so we have
to restore that.
mp_image didn't set chroma shifts for yuy2.
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/mp_image.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libmpcodecs/mp_image.c b/libmpcodecs/mp_image.c index 1ba9e8e753..f01e416b01 100644 --- a/libmpcodecs/mp_image.c +++ b/libmpcodecs/mp_image.c @@ -196,6 +196,9 @@ void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){ mpi->flags|=MP_IMGFLAG_SWAPPED; case IMGFMT_YUY2: mpi->chroma_x_shift = 1; + mpi->chroma_y_shift = 1; + mpi->chroma_width=(mpi->width>>1); + mpi->chroma_height=(mpi->height>>1); mpi->bpp=16; mpi->num_planes=1; return; |