diff options
author | James Stembridge <jstembridge@users.sourceforge.net> | 2004-02-09 22:04:11 +0000 |
---|---|---|
committer | James Stembridge <jstembridge@users.sourceforge.net> | 2004-02-09 22:04:11 +0000 |
commit | 37b34df0b811fbd7e0a4b39dd4a7fe2fd3e37756 (patch) | |
tree | b72f943db9e7a45c28d8673859c88be1030e5b19 | |
parent | f32ff1b1bdf6d7362e254e6a53e1efe8f51d0547 (diff) | |
download | xine-lib-37b34df0b811fbd7e0a4b39dd4a7fe2fd3e37756.tar.gz xine-lib-37b34df0b811fbd7e0a4b39dd4a7fe2fd3e37756.tar.bz2 |
Only read frame duration when BUF_FLAG_FRAMERATE is set
CVS patchset: 6125
CVS date: 2004/02/09 22:04:11
-rw-r--r-- | src/libxinevdec/bitplane.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/cinepak.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/cyuv.c | 7 | ||||
-rw-r--r-- | src/libxinevdec/fli.c | 9 | ||||
-rw-r--r-- | src/libxinevdec/foovideo.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/idcinvideo.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/interplayvideo.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/msrle.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/msvc.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/qtrle.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/qtrpza.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/qtsmc.c | 11 | ||||
-rw-r--r-- | src/libxinevdec/rgb.c | 12 | ||||
-rw-r--r-- | src/libxinevdec/roqvideo.c | 7 | ||||
-rw-r--r-- | src/libxinevdec/svq1.c | 12 | ||||
-rw-r--r-- | src/libxinevdec/wc3video.c | 12 | ||||
-rw-r--r-- | src/libxinevdec/yuv.c | 16 |
17 files changed, 98 insertions, 87 deletions
diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index 71103dedf..cbc78760a 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -22,7 +22,7 @@ * suitable for display under xine. It's based on the rgb-decoder * and the development documentation from the Amiga Developer CD * - * $Id: bitplane.c,v 1.1 2004/02/02 22:22:52 manfredtremmel Exp $ + * $Id: bitplane.c,v 1.2 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -155,6 +155,11 @@ static void bitplane_decode_data (video_decoder_t *this_gen, return; } + + 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); @@ -167,7 +172,6 @@ static void bitplane_decode_data (video_decoder_t *this_gen, this->width_decode = (bih->biWidth + 15) & ~0x0f; this->height = bih->biHeight; this->ratio = (double)this->width/(double)this->height; - this->video_step = buf->decoder_info[1]; /* Palette based Formates use up to 8 Bit per pixel, always use 8 Bit if less */ this->bytes_per_pixel = (bih->biBitCount + 1) / 8; if( this->bytes_per_pixel < 1 ) @@ -230,9 +234,6 @@ static void bitplane_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, diff --git a/src/libxinevdec/cinepak.c b/src/libxinevdec/cinepak.c index 4e75c4de8..a2fa78cce 100644 --- a/src/libxinevdec/cinepak.c +++ b/src/libxinevdec/cinepak.c @@ -22,7 +22,7 @@ * based on overview of Cinepak algorithm and example decoder * by Tim Ferguson: http://www.csse.monash.edu.au/~timf/ * - * $Id: cinepak.c,v 1.37 2004/01/12 17:35:18 miguelfreitas Exp $ + * $Id: cinepak.c,v 1.38 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdlib.h> @@ -387,13 +387,17 @@ static void cvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { COMPUTE_V(palette[i].r, palette[i].g, palette[i].b); } } + + 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) { xine_bmiheader *bih; int chroma_size; bih = (xine_bmiheader *) buf->content; - this->video_step = buf->decoder_info[1]; this->width = (bih->biWidth + 1) & ~0x1; this->height = (bih->biHeight + 1) & ~0x1; @@ -434,9 +438,6 @@ static void cvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { 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) { vo_frame_t *img; diff --git a/src/libxinevdec/cyuv.c b/src/libxinevdec/cyuv.c index fea47873b..b8393bc97 100644 --- a/src/libxinevdec/cyuv.c +++ b/src/libxinevdec/cyuv.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: cyuv.c,v 1.25 2004/01/12 17:35:18 miguelfreitas Exp $ + * $Id: cyuv.c,v 1.26 2004/02/09 22:04:11 jstembridge Exp $ */ /* And this is the header that came with the CYUV decoder: */ @@ -161,7 +161,6 @@ static void cyuv_decode_data (video_decoder_t *this_gen, this->height = *(unsigned int *)&buf->content[8]; this->ratio = (double)this->width/(double)this->height; this->skipframes = 0; - this->video_step = buf->decoder_info[1]; _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, "Creative YUV"); @@ -178,8 +177,10 @@ static void cyuv_decode_data (video_decoder_t *this_gen, xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size); this->size += buf->size; - if (buf->decoder_flags & BUF_FLAG_FRAMERATE) + 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_FRAME_END) { /* time to decode a frame */ img = this->stream->video_out->get_frame (this->stream->video_out, diff --git a/src/libxinevdec/fli.c b/src/libxinevdec/fli.c index 00b64dc8d..1baa1f6a5 100644 --- a/src/libxinevdec/fli.c +++ b/src/libxinevdec/fli.c @@ -23,7 +23,7 @@ * avoid when implementing a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: fli.c,v 1.26 2004/01/12 17:35:18 miguelfreitas Exp $ + * $Id: fli.c,v 1.27 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -427,6 +427,9 @@ static void fli_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; + if (buf->decoder_flags & BUF_FLAG_FRAMERATE) + this->video_step = buf->decoder_info[0]; + if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); @@ -437,7 +440,6 @@ static void fli_decode_data (video_decoder_t *this_gen, this->width = (LE_16(&buf->content[8]) + 1) & ~0x1; this->height = LE_16(&buf->content[10]); this->ratio = (double)this->width/(double)this->height; - this->video_step = buf->decoder_info[1]; this->magic_number = LE_16(&buf->content[4]); this->ghost_image = xine_xmalloc(this->width * this->height); @@ -467,9 +469,6 @@ static void fli_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, diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index ac0f089a6..f87d9ed01 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -23,7 +23,7 @@ * value from the last frame. This creates a slowly rotating solid color * frame when the frames are played in succession. * - * $Id: foovideo.c,v 1.21 2004/01/12 17:35:18 miguelfreitas Exp $ + * $Id: foovideo.c,v 1.22 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -92,6 +92,11 @@ static void foovideo_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; + 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); @@ -102,7 +107,6 @@ static void foovideo_decode_data (video_decoder_t *this_gen, this->width = bih->biWidth; this->height = bih->biHeight; this->ratio = (double)this->width/(double)this->height; - this->video_step = buf->decoder_info[1]; if (this->buf) free (this->buf); @@ -130,9 +134,6 @@ static void foovideo_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, diff --git a/src/libxinevdec/idcinvideo.c b/src/libxinevdec/idcinvideo.c index 9fd646acc..65308eb4a 100644 --- a/src/libxinevdec/idcinvideo.c +++ b/src/libxinevdec/idcinvideo.c @@ -21,7 +21,7 @@ * the Id CIN format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: idcinvideo.c,v 1.22 2004/01/12 17:35:18 miguelfreitas Exp $ + * $Id: idcinvideo.c,v 1.23 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -233,6 +233,11 @@ static void idcinvideo_decode_data (video_decoder_t *this_gen, COMPUTE_V(palette[i].r, palette[i].g, palette[i].b); } } + + 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 */ xine_bmiheader *bih = (xine_bmiheader *)buf->content; @@ -245,7 +250,6 @@ static void idcinvideo_decode_data (video_decoder_t *this_gen, this->width = bih->biWidth; this->height = bih->biHeight; this->ratio = (double)this->width/(double)this->height; - this->video_step = buf->decoder_info[1]; /* initialize the Huffman tables */ histograms = (unsigned char *)buf->content + sizeof(xine_bmiheader); @@ -281,9 +285,6 @@ static void idcinvideo_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, diff --git a/src/libxinevdec/interplayvideo.c b/src/libxinevdec/interplayvideo.c index 7bed08b5f..503db7004 100644 --- a/src/libxinevdec/interplayvideo.c +++ b/src/libxinevdec/interplayvideo.c @@ -21,7 +21,7 @@ * For more information regarding the Interplay MVE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: interplayvideo.c,v 1.11 2004/01/12 17:35:18 miguelfreitas Exp $ + * $Id: interplayvideo.c,v 1.12 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -1151,6 +1151,11 @@ static void interplay_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); @@ -1160,7 +1165,6 @@ static void interplay_decode_data (video_decoder_t *this_gen, this->width = (buf->content[0] << 8) | buf->content[1]; this->height = (buf->content[2] << 8) | buf->content[3]; this->ratio = (double)this->width/(double)this->height; - this->video_step = buf->decoder_info[1]; if (this->buf) free (this->buf); @@ -1202,9 +1206,6 @@ static void interplay_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, diff --git a/src/libxinevdec/msrle.c b/src/libxinevdec/msrle.c index fb189f738..ded2ed56a 100644 --- a/src/libxinevdec/msrle.c +++ b/src/libxinevdec/msrle.c @@ -21,7 +21,7 @@ * For more information on the MS RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: msrle.c,v 1.25 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: msrle.c,v 1.26 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -206,6 +206,11 @@ static void msrle_decode_data (video_decoder_t *this_gen, COMPUTE_V(palette[i].r, palette[i].g, palette[i].b); } } + + 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); @@ -217,7 +222,6 @@ static void msrle_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]; if (this->buf) free (this->buf); @@ -245,9 +249,6 @@ static void msrle_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, diff --git a/src/libxinevdec/msvc.c b/src/libxinevdec/msvc.c index 2c17b5eb4..a2be6dbc0 100644 --- a/src/libxinevdec/msvc.c +++ b/src/libxinevdec/msvc.c @@ -22,7 +22,7 @@ * based on overview of Microsoft Video-1 algorithm * by Mike Melanson: http://www.pcisys.net/~melanson/codecs/video1.txt * - * $Id: msvc.c,v 1.29 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: msvc.c,v 1.30 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdlib.h> @@ -222,13 +222,17 @@ static void msvc_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { (palette[i].b << 0), &this->color_table[i]); } + + 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) { xine_bmiheader *bih; int image_size; bih = (xine_bmiheader *) buf->content; - this->video_step = buf->decoder_info[1]; this->width = (bih->biWidth + 1) & ~0x1; this->height = bih->biHeight; @@ -269,9 +273,6 @@ static void msvc_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { 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) { vo_frame_t *img; diff --git a/src/libxinevdec/qtrle.c b/src/libxinevdec/qtrle.c index e66d93526..445dc71d7 100644 --- a/src/libxinevdec/qtrle.c +++ b/src/libxinevdec/qtrle.c @@ -21,7 +21,7 @@ * For more information on the QT RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrle.c,v 1.19 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: qtrle.c,v 1.20 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -836,6 +836,11 @@ static void qtrle_decode_data (video_decoder_t *this_gen, COMPUTE_V(palette[i].r, palette[i].g, palette[i].b); } } + + 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); @@ -848,7 +853,6 @@ static void qtrle_decode_data (video_decoder_t *this_gen, this->height = bih->biHeight; this->ratio = (double)this->width/(double)this->height; this->depth = bih->biBitCount; - this->video_step = buf->decoder_info[1]; if (this->buf) free (this->buf); @@ -876,9 +880,6 @@ static void qtrle_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, diff --git a/src/libxinevdec/qtrpza.c b/src/libxinevdec/qtrpza.c index 542413071..f27593f5e 100644 --- a/src/libxinevdec/qtrpza.c +++ b/src/libxinevdec/qtrpza.c @@ -21,7 +21,7 @@ * For more information about the RPZA format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrpza.c,v 1.23 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: qtrpza.c,v 1.24 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -299,6 +299,11 @@ static void qtrpza_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; + 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); @@ -309,7 +314,6 @@ static void qtrpza_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]; if (this->buf) free (this->buf); @@ -337,9 +341,6 @@ static void qtrpza_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, diff --git a/src/libxinevdec/qtsmc.c b/src/libxinevdec/qtsmc.c index 7643867ff..1230062e0 100644 --- a/src/libxinevdec/qtsmc.c +++ b/src/libxinevdec/qtsmc.c @@ -23,7 +23,7 @@ * For more information on the SMC format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtsmc.c,v 1.23 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: qtsmc.c,v 1.24 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -530,6 +530,11 @@ static void qtsmc_decode_data (video_decoder_t *this_gen, COMPUTE_V(palette[i].r, palette[i].g, palette[i].b); } } + + 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); @@ -541,7 +546,6 @@ static void qtsmc_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]; if (this->buf) free (this->buf); @@ -569,9 +573,6 @@ static void qtsmc_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, 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 <stdio.h> @@ -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, diff --git a/src/libxinevdec/roqvideo.c b/src/libxinevdec/roqvideo.c index cfd4bbef1..7a316bfd6 100644 --- a/src/libxinevdec/roqvideo.c +++ b/src/libxinevdec/roqvideo.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: roqvideo.c,v 1.27 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: roqvideo.c,v 1.28 2004/02/09 22:04:11 jstembridge Exp $ */ /* And this is the header that came with the RoQ video decoder: */ @@ -405,7 +405,6 @@ static void roqvideo_decode_data (video_decoder_t *this_gen, this->height = bih->biHeight; this->ratio = (double)this->width/(double)this->height; this->skipframes = 0; - this->video_step = buf->decoder_info[1]; this->current_planes = 0; this->y_size = this->width * this->height; @@ -442,8 +441,10 @@ static void roqvideo_decode_data (video_decoder_t *this_gen, xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size); this->size += buf->size; - if (buf->decoder_flags & BUF_FLAG_FRAMERATE) + 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_FRAME_END) { /* time to decode a frame */ img = this->stream->video_out->get_frame (this->stream->video_out, diff --git a/src/libxinevdec/svq1.c b/src/libxinevdec/svq1.c index 63979be36..6c93eb1ab 100644 --- a/src/libxinevdec/svq1.c +++ b/src/libxinevdec/svq1.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: svq1.c,v 1.31 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: svq1.c,v 1.32 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -1327,9 +1327,12 @@ static void svq1dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - if (buf->decoder_flags & BUF_FLAG_STDHEADER) { - this->video_step = buf->decoder_info[1]; + 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) { if (this->buf) free (this->buf); this->bufsize = VIDEOBUFSIZE; @@ -1353,9 +1356,6 @@ static void svq1dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) 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) { vo_frame_t *img; diff --git a/src/libxinevdec/wc3video.c b/src/libxinevdec/wc3video.c index a68a1dc39..68ba2b43f 100644 --- a/src/libxinevdec/wc3video.c +++ b/src/libxinevdec/wc3video.c @@ -22,7 +22,7 @@ * For more information on the WC3 Movie format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: wc3video.c,v 1.19 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: wc3video.c,v 1.20 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -365,6 +365,11 @@ static void wc3video_decode_data (video_decoder_t *this_gen, COMPUTE_V(palette[i].r, palette[i].g, palette[i].b); } } + + 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_HEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); @@ -372,8 +377,6 @@ static void wc3video_decode_data (video_decoder_t *this_gen, if(this->buf) free(this->buf); - this->video_step = buf->decoder_info[1]; - if (this->buf) free (this->buf); this->bufsize = VIDEOBUFSIZE; @@ -401,9 +404,6 @@ static void wc3video_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, diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index 2db40d293..f9aa79274 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.29 2004/01/12 17:35:19 miguelfreitas Exp $ + * $Id: yuv.c,v 1.30 2004/02/09 22:04:11 jstembridge Exp $ */ #include <stdio.h> @@ -86,6 +86,11 @@ static void yuv_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; + 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); @@ -96,9 +101,7 @@ static void yuv_decode_data (video_decoder_t *this_gen, this->width = (bih->biWidth + 3) & ~0x03; this->height = (bih->biHeight + 3) & ~0x03; - this->video_step = buf->decoder_info[1]; - - this->progressive = buf->decoder_info[0]; + this->progressive = buf->decoder_info[1]; this->top_field_first = buf->decoder_info[2]; if(buf->decoder_info[3] && buf->decoder_info[4]) @@ -135,8 +138,6 @@ static void yuv_decode_data (video_decoder_t *this_gen, } - _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step); - return; } else if (this->decoder_ok && !(buf->decoder_flags & BUF_FLAG_SPECIAL)) { @@ -149,9 +150,6 @@ static void yuv_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) { if (buf->type == BUF_VIDEO_YV12) { |