From 1ac90ffd4e9f4c26ac8b4027dcfd91a8bf92c2ec Mon Sep 17 00:00:00 2001 From: Torsten Jager Date: Thu, 10 May 2012 15:43:52 +0300 Subject: ff_video_decoder: fixed cropping --- src/combined/ffmpeg/ff_video_decoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 60bb55f44..11f07565c 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -1619,8 +1619,8 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { img->duration = video_step_to_use; /* additionally crop away the extra pixels due to adjusting frame size above */ - img->crop_right = this->crop_right + (img->width - this->bih.biWidth); - img->crop_bottom = this->crop_bottom + (img->height - this->bih.biHeight); + img->crop_right = img->width - this->bih.biWidth; + img->crop_bottom = img->height - this->bih.biHeight; /* transfer some more frame settings for deinterlacing */ img->progressive_frame = !this->av_frame->interlaced_frame; @@ -1656,8 +1656,8 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { img->duration = video_step_to_use; /* additionally crop away the extra pixels due to adjusting frame size above */ - img->crop_right = ((this->bih.biWidth <= 0) ? 0 : this->crop_right) + (img->width - this->bih.biWidth); - img->crop_bottom = ((this->bih.biHeight <= 0) ? 0 : this->crop_bottom) + (img->height - this->bih.biHeight); + img->crop_right = this->bih.biWidth <= 0 ? 0 : (img->width - this->bih.biWidth); + img->crop_bottom = this->bih.biHeight <= 0 ? 0 : (img->height - this->bih.biHeight); img->bad_frame = 1; this->skipframes = img->draw(img, this->stream); -- cgit v1.2.3