summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Stembridge <jstembridge@users.sourceforge.net>2004-02-09 22:13:54 +0000
committerJames Stembridge <jstembridge@users.sourceforge.net>2004-02-09 22:13:54 +0000
commitca689b36373e820c26caa4c1b34679ca1a6038be (patch)
tree48dd691f480fcb859ef4cbd1fdf9da3c0e22fed5
parent5fbef27bfd3bbb0a391332836d3813b6f0186d74 (diff)
downloadxine-lib-ca689b36373e820c26caa4c1b34679ca1a6038be.tar.gz
xine-lib-ca689b36373e820c26caa4c1b34679ca1a6038be.tar.bz2
Only read frame duration when BUF_FLAG_FRAMERATE is set
CVS patchset: 6127 CVS date: 2004/02/09 22:13:54
-rw-r--r--src/libdivx4/xine_decoder.c7
-rw-r--r--src/libw32dll/w32codec.c16
-rw-r--r--src/libxvid/xine_decoder.c7
3 files changed, 18 insertions, 12 deletions
diff --git a/src/libdivx4/xine_decoder.c b/src/libdivx4/xine_decoder.c
index b5fe974d4..7b9941ee9 100644
--- a/src/libdivx4/xine_decoder.c
+++ b/src/libdivx4/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.49 2004/01/09 01:26:33 miguelfreitas Exp $
+ * $Id: xine_decoder.c,v 1.50 2004/02/09 22:13:54 jstembridge Exp $
*
* xine decoder plugin using divx4
*
@@ -224,7 +224,6 @@ static int divx4_init_decoder(divx4_decoder_t *this, buf_element_t *buf) {
lprintf ("init_decoder\n");
memcpy ( &this->bih, buf->content, sizeof (xine_bmiheader));
- this->video_step = buf->decoder_info[1];
codec_type = buf->type & 0xFFFF0000;
@@ -408,8 +407,10 @@ static void divx4_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
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) { /* need to decode a frame */
/* allocate image (taken from ffmpeg plugin) */
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c
index 8296c348c..e0b62c582 100644
--- a/src/libw32dll/w32codec.c
+++ b/src/libw32dll/w32codec.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: w32codec.c,v 1.138 2004/01/12 17:35:17 miguelfreitas Exp $
+ * $Id: w32codec.c,v 1.139 2004/02/09 22:16:54 jstembridge Exp $
*
* routines for using w32 codecs
* DirectShow support by Miguel Freitas (Nov/2001)
@@ -750,6 +750,13 @@ static void w32v_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_FRAMERATE) {
+ this->video_step = buf->decoder_info[0];
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step);
+
+ lprintf ("video_step is %lld\n", this->video_step);
+ }
+
if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
int num_decoders;
@@ -763,15 +770,11 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
free( this->bih );
this->bih = malloc(buf->size);
memcpy ( this->bih, buf->content, buf->size );
- this->video_step = buf->decoder_info[1];
this->ratio = (double)this->bih->biWidth/(double)this->bih->biHeight;
_x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->bih->biWidth);
_x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->bih->biHeight);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step);
-
- lprintf ("video_step is %lld\n", this->video_step);
pthread_mutex_lock(&win32_codec_mutex);
num_decoders = get_vids_codec_n_name (this, buf->type);
@@ -830,9 +833,6 @@ static void w32v_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) {
HRESULT ret = 0;
diff --git a/src/libxvid/xine_decoder.c b/src/libxvid/xine_decoder.c
index 6acecf747..f8856edaa 100644
--- a/src/libxvid/xine_decoder.c
+++ b/src/libxvid/xine_decoder.c
@@ -85,13 +85,18 @@ static void xvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
lprintf ("processing packet type = %08x, buf: %08x, buf->decoder_flags=%08x\n",
buf->type, buf, buf->decoder_flags);
+ if (buf->decoder_flags & BUF_FLAG_FRAMERATE) {
+ this->frame_duration = 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;
XVID_DEC_PARAM xparam;
/* initialize data describing video stream */
bih = (xine_bmiheader *) buf->content;
- this->frame_duration = buf->decoder_info[1];
this->frame_width = bih->biWidth;
this->frame_height = bih->biHeight;
this->ratio = (double)bih->biWidth/(double)bih->biHeight;