From 37b34df0b811fbd7e0a4b39dd4a7fe2fd3e37756 Mon Sep 17 00:00:00 2001 From: James Stembridge Date: Mon, 9 Feb 2004 22:04:11 +0000 Subject: Only read frame duration when BUF_FLAG_FRAMERATE is set CVS patchset: 6125 CVS date: 2004/02/09 22:04:11 --- src/libxinevdec/rgb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/libxinevdec/rgb.c') diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index a629123f3..c13f25a9d 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -21,7 +21,7 @@ * Actually, this decoder just converts a raw RGB image to a YUY2 map * suitable for display under xine. * - * $Id: rgb.c,v 1.25 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: rgb.c,v 1.26 2004/02/09 22:04:11 jstembridge Exp $ */ #include @@ -99,6 +99,11 @@ static void rgb_decode_data (video_decoder_t *this_gen, } } + if (buf->decoder_flags & BUF_FLAG_FRAMERATE) { + this->video_step = buf->decoder_info[0]; + _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step); + } + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); @@ -109,7 +114,7 @@ static void rgb_decode_data (video_decoder_t *this_gen, this->width = (bih->biWidth + 3) & ~0x03; this->height = (bih->biHeight + 3) & ~0x03; this->ratio = (double)this->width/(double)this->height; - this->video_step = buf->decoder_info[1]; + /* round this number up in case of 15 */ this->bytes_per_pixel = (bih->biBitCount + 1) / 8; @@ -139,9 +144,6 @@ static void rgb_decode_data (video_decoder_t *this_gen, this->size += buf->size; - if (buf->decoder_flags & BUF_FLAG_FRAMERATE) - this->video_step = buf->decoder_info[0]; - if (buf->decoder_flags & BUF_FLAG_FRAME_END) { img = this->stream->video_out->get_frame (this->stream->video_out, -- cgit v1.2.3