diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2006-03-10 13:55:48 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2006-03-10 13:55:48 +0000 |
commit | f2651e7a6c7a9f492158a36af635eb4fb8ebac36 (patch) | |
tree | 20534ab9cae169e3c02019196bacf72fdf5d6efe /ffmpeg.c | |
parent | 4c4a4e9afefc98699f0c720f363e1ce66d8a745d (diff) | |
download | ffmpeg-f2651e7a6c7a9f492158a36af635eb4fb8ebac36.tar.gz |
Fix cropping, depending on enc pix fmt
Originally committed as revision 5134 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 18 |
1 files changed, 4 insertions, 14 deletions
@@ -847,20 +847,10 @@ static void do_video_out(AVFormatContext *s, } } } 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; |