[MPlayer-cvslog] r34753 - trunk/libmpcodecs/vf.c

reimar subversion at mplayerhq.hu
Tue Feb 21 21:40:59 CET 2012


Author: reimar
Date: Tue Feb 21 21:40:59 2012
New Revision: 34753

Log:
Adjust MPlayer default alignment values to match FFmpeg's.
Fixes "stride changed" errors when using e.g. MPEG-2 decoder
with -vf unsharp.

Modified:
   trunk/libmpcodecs/vf.c

Modified: trunk/libmpcodecs/vf.c
==============================================================================
--- trunk/libmpcodecs/vf.c	Tue Feb 21 20:44:21 2012	(r34752)
+++ trunk/libmpcodecs/vf.c	Tue Feb 21 21:40:59 2012	(r34753)
@@ -290,7 +290,7 @@ mp_image_t* vf_get_image(vf_instance_t* 
   if (w == -1) w = vf->w;
   if (h == -1) h = vf->h;
 
-  w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w;
+  w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?FFALIGN(w, 32):w;
 
   if(vf->put_image==vf_next_put_image){
       // passthru mode, if the filter uses the fallback/default put_image() code
@@ -382,8 +382,8 @@ mp_image_t* vf_get_image(vf_instance_t* 
           if(mp_imgflag&MP_IMGFLAG_PREFER_ALIGNED_STRIDE){
               int align=(mpi->flags&MP_IMGFLAG_PLANAR &&
                          mpi->flags&MP_IMGFLAG_YUV) ?
-                         (8<<mpi->chroma_x_shift)-1 : 15; // -- maybe FIXME
-              w2=((w+align)&(~align));
+                         (16<<mpi->chroma_x_shift) : 32; // -- maybe FIXME
+              w2=FFALIGN(w, align);
               if(mpi->width!=w2){
                   // we have to change width... check if we CAN co it:
                   int flags=vf->query_format(vf,outfmt); // should not fail


More information about the MPlayer-cvslog mailing list