From c6b78d5e4d5ec29f1a67941b7fbbe326e49eb0ca Mon Sep 17 00:00:00 2001 From: James Stembridge Date: Thu, 29 May 2003 01:04:54 +0000 Subject: Revert last change as it caused problems with some streams. Second and much simpler attempt at keeping width and height passed to get_frame consistant. CVS patchset: 4981 CVS date: 2003/05/29 01:04:54 --- src/libffmpeg/xine_decoder.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index b30de9bbe..f7efebf9f 100644 --- a/src/libffmpeg/xine_decoder.c +++ b/src/libffmpeg/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.121 2003/05/28 18:16:46 jstembridge Exp $ + * $Id: xine_decoder.c,v 1.122 2003/05/29 01:04:54 jstembridge Exp $ * * xine decoder plugin using ffmpeg * @@ -145,7 +145,13 @@ static pthread_once_t once_control = PTHREAD_ONCE_INIT; static int get_buffer(AVCodecContext *context, AVFrame *av_frame){ ff_video_decoder_t * this = (ff_video_decoder_t *)context->opaque; vo_frame_t *img; + int align, width, height; + align=15; + + width = (context->width +align)&~align; + height = (context->height+align)&~align; + if( this->context->pix_fmt != PIX_FMT_YUV420P ) { if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) printf("ffmpeg: unsupported frame format, DR1 disabled.\n"); @@ -156,8 +162,8 @@ static int get_buffer(AVCodecContext *context, AVFrame *av_frame){ } img = this->stream->video_out->get_frame (this->stream->video_out, - this->context->width, - this->context->height, + width, + height, this->xine_aspect_ratio, this->output_format, VO_BOTH_FIELDS); @@ -277,9 +283,6 @@ static void init_video_codec (ff_video_decoder_t *this, xine_bmiheader *bih) { #ifdef ENABLE_DIRECT_RENDERING if( this->context->pix_fmt == PIX_FMT_YUV420P && this->codec->capabilities & CODEC_CAP_DR1 ) { - this->context->width = (this->context->width + 15) & ~15; - this->context->height = (this->context->height + 15) & ~15; - this->context->get_buffer = get_buffer; this->context->release_buffer = release_buffer; if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) @@ -904,8 +907,8 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { tmp_img = img; img = this->stream->video_out->get_frame (this->stream->video_out, - this->context->width, - this->context->height, + img->width, + img->height, this->xine_aspect_ratio, this->output_format, VO_BOTH_FIELDS); @@ -915,7 +918,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { pp_postprocess(this->av_frame->data, this->av_frame->linesize, img->base, img->pitches, - this->context->width, this->context->height, + img->width, img->height, this->av_frame->qscale_table, this->av_frame->qstride, this->pp_mode, this->pp_context, this->av_frame->pict_type); -- cgit v1.2.3