summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_mpeg.c
diff options
context:
space:
mode:
authorThomas Hellström <totte67@users.sourceforge.net>2005-02-22 18:31:33 +0000
committerThomas Hellström <totte67@users.sourceforge.net>2005-02-22 18:31:33 +0000
commit081ee8763663ffb98145ea232cad0260bb93aef2 (patch)
tree832625e851f76e0e9c661130c0ade972f784009c /src/demuxers/demux_mpeg.c
parent1a73f221fdf055c093e7b9c74d49795c6007b06e (diff)
downloadxine-lib-081ee8763663ffb98145ea232cad0260bb93aef2.tar.gz
xine-lib-081ee8763663ffb98145ea232cad0260bb93aef2.tar.bz2
XvMC update largely courtesy of Kendall Bennet, Scitechsoft:
* Fix surface flushing and syncing (xxmc / xvmc) * Fix clearing of macro block lists (xxmc / xvmc) * Remove floating point operations from mpeg demuxer. Degrades performance on non-fp capable hardware. * Remove unnecessary software MC step * Fix Quantization matrix ordering which caused bad picture quality (KB/TH) * Minor optimizations in the libmpeg2 code * Fix VLD flushing at video discontinuity (TH) CVS patchset: 7424 CVS date: 2005/02/22 18:31:33
Diffstat (limited to 'src/demuxers/demux_mpeg.c')
-rw-r--r--src/demuxers/demux_mpeg.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index a788fb87d..f3cd43475 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_mpeg.c,v 1.146 2005/02/06 15:26:17 tmattern Exp $
+ * $Id: demux_mpeg.c,v 1.147 2005/02/22 18:31:37 totte67 Exp $
*
* demultiplexer for mpeg 1/2 program streams
* reads streams of variable blocksizes
@@ -358,8 +358,9 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
buf->decoder_flags = BUF_FLAG_PREVIEW;
if( this->input->get_length (this->input) )
- buf->extra_info->input_normpos = (int)( (double) this->input->get_current_pos (this->input) *
- 65535 / this->input->get_length (this->input) );
+ buf->extra_info->input_normpos =
+ (int)( ((int64_t)this->input->get_current_pos (this->input) *
+ 65535) / this->input->get_length (this->input) );
if (this->rate)
buf->extra_info->input_time = (int)((int64_t)this->input->get_current_pos (this->input)
@@ -390,8 +391,9 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
buf->decoder_flags |= BUF_FLAG_PREVIEW;
if( this->input->get_length (this->input) )
- buf->extra_info->input_normpos = (int)( (double) this->input->get_current_pos (this->input) *
- 65535 / this->input->get_length (this->input) );
+ buf->extra_info->input_normpos =
+ (int)( ((int64_t)this->input->get_current_pos (this->input) *
+ 65535) / this->input->get_length (this->input) );
if (this->rate)
buf->extra_info->input_time = (int)((int64_t)this->input->get_current_pos (this->input)
* 1000 / (this->rate * 50));
@@ -453,8 +455,9 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
buf->decoder_flags = BUF_FLAG_PREVIEW;
if( this->input->get_length (this->input) )
- buf->extra_info->input_normpos = (int)( (double) this->input->get_current_pos (this->input) *
- 65535 / this->input->get_length (this->input) );
+ buf->extra_info->input_normpos =
+ (int)( ((int64_t)this->input->get_current_pos (this->input) *
+ 65535) / this->input->get_length (this->input) );
if (this->rate)
buf->extra_info->input_time = (int)((int64_t)this->input->get_current_pos (this->input)
* 1000 / (this->rate * 50));
@@ -525,8 +528,9 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
buf->decoder_flags = BUF_FLAG_PREVIEW;
if( this->input->get_length (this->input) )
- buf->extra_info->input_normpos = (int)( (double) this->input->get_current_pos (this->input) *
- 65535 / this->input->get_length (this->input) );
+ buf->extra_info->input_normpos =
+ (int)( ((int64_t)this->input->get_current_pos (this->input) *
+ 65535) / this->input->get_length (this->input) );
if (this->rate)
buf->extra_info->input_time = (int)((int64_t)this->input->get_current_pos (this->input)
* 1000 / (this->rate * 50));
@@ -655,8 +659,9 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
buf->decoder_flags = BUF_FLAG_PREVIEW;
if( this->input->get_length (this->input) )
- buf->extra_info->input_normpos = (int)( (double) this->input->get_current_pos (this->input) *
- 65535 / this->input->get_length (this->input) );
+ buf->extra_info->input_normpos =
+ (int)( ((int64_t)this->input->get_current_pos (this->input) *
+ 65535) / this->input->get_length (this->input) );
if (this->rate)
buf->extra_info->input_time = (int)((int64_t)this->input->get_current_pos (this->input)
* 1000 / (this->rate * 50));
@@ -689,8 +694,9 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
buf->decoder_flags = BUF_FLAG_PREVIEW;
if( this->input->get_length (this->input) )
- buf->extra_info->input_normpos = (int)( (double) this->input->get_current_pos (this->input) *
- 65535 / this->input->get_length (this->input) );
+ buf->extra_info->input_normpos =
+ (int)( ((int64_t)this->input->get_current_pos (this->input) *
+ 65535) / this->input->get_length (this->input) );
if (this->rate)
buf->extra_info->input_time = (int)((int64_t)this->input->get_current_pos (this->input)
* 1000 / (this->rate * 50));
@@ -1002,8 +1008,7 @@ static int demux_mpeg_seek (demux_plugin_t *this_gen,
demux_mpeg_t *this = (demux_mpeg_t *) this_gen;
start_time /= 1000;
- start_pos = (off_t) ( (double) start_pos / 65535 *
- this->input->get_length (this->input) );
+ start_pos = (off_t) ( ((int64_t)start_pos * this->input->get_length (this->input)) / 65535);
if (INPUT_IS_SEEKABLE(this->input)) {