[Ffmpeg-cvslog] CVS: ffmpeg ffmpeg.c,1.371,1.372

Baptiste Coudurier CVS bcoudurier
Fri Mar 10 14:55:51 CET 2006


Update of /cvsroot/ffmpeg/ffmpeg
In directory mail:/var2/tmp/cvs-serv1823

Modified Files:
	ffmpeg.c 
Log Message:
Fix cropping, depending on enc pix fmt

Index: ffmpeg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/ffmpeg.c,v
retrieving revision 1.371
retrieving revision 1.372
diff -u -d -r1.371 -r1.372
--- ffmpeg.c	9 Mar 2006 15:27:22 -0000	1.371
+++ ffmpeg.c	10 Mar 2006 13:55:48 -0000	1.372
@@ -847,20 +847,10 @@
             }
         }
     } else if (ost->video_crop) {
-        picture_crop_temp.data[0] = formatted_picture->data[0] +
-                (ost->topBand * formatted_picture->linesize[0]) + ost->leftBand;
-
-        picture_crop_temp.data[1] = formatted_picture->data[1] +
-                ((ost->topBand >> 1) * formatted_picture->linesize[1]) +
-                (ost->leftBand >> 1);
-
-        picture_crop_temp.data[2] = formatted_picture->data[2] +
-                ((ost->topBand >> 1) * formatted_picture->linesize[2]) +
-                (ost->leftBand >> 1);
-
-        picture_crop_temp.linesize[0] = formatted_picture->linesize[0];
-        picture_crop_temp.linesize[1] = formatted_picture->linesize[1];
-        picture_crop_temp.linesize[2] = formatted_picture->linesize[2];
+        if (img_crop((AVPicture *)&picture_crop_temp, (AVPicture *)formatted_picture, enc->pix_fmt, ost->topBand, ost->leftBand) < 0) {
+            av_log(NULL, AV_LOG_ERROR, "error cropping picture\n");
+            goto the_end;
+        }
         final_picture = &picture_crop_temp;
     } else if (ost->video_pad) {
         final_picture = &ost->pict_tmp;





More information about the ffmpeg-cvslog mailing list