From 351e2803fd969a77e02674fcfb0e9dcd7cd5f8fd Mon Sep 17 00:00:00 2001 From: James Stembridge Date: Sat, 14 Feb 2004 20:29:53 +0000 Subject: Read aspect when BUF_FLAG_ASPECT is set CVS patchset: 6156 CVS date: 2004/02/14 20:29:53 --- src/libxinevdec/yuv.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/libxinevdec') diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index f9aa79274..aac77710a 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -21,7 +21,7 @@ * Actually, this decoder just reorganizes chunks of raw YUV data in such * a way that xine can display them. * - * $Id: yuv.c,v 1.30 2004/02/09 22:04:11 jstembridge Exp $ + * $Id: yuv.c,v 1.31 2004/02/14 20:29:53 jstembridge Exp $ */ #include @@ -101,14 +101,14 @@ static void yuv_decode_data (video_decoder_t *this_gen, this->width = (bih->biWidth + 3) & ~0x03; this->height = (bih->biHeight + 3) & ~0x03; - this->progressive = buf->decoder_info[1]; - this->top_field_first = buf->decoder_info[2]; - - if(buf->decoder_info[3] && buf->decoder_info[4]) - this->ratio = (double)buf->decoder_info[3]/(double)buf->decoder_info[4]; + if (buf->decoder_flags & BUF_FLAG_ASPECT) + this->ratio = (double)buf->decoder_info[1] / (double)buf->decoder_info[2]; else - this->ratio = (double)this->width/(double)this->height; + this->ratio = (double)this->width / (double)this->height; + this->progressive = buf->decoder_info[3]; + this->top_field_first = buf->decoder_info[4]; + if (this->buf) free (this->buf); this->bufsize = VIDEOBUFSIZE; @@ -138,6 +138,10 @@ static void yuv_decode_data (video_decoder_t *this_gen, } + _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->width); + _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->height); + _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, this->ratio*10000); + return; } else if (this->decoder_ok && !(buf->decoder_flags & BUF_FLAG_SPECIAL)) { -- cgit v1.2.3