summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/demuxers/demux_avi.c8
-rw-r--r--src/demuxers/demux_mpeg_block.c94
-rw-r--r--src/demuxers/demux_pes.c5
-rw-r--r--src/libmpg123/interface.c4
-rw-r--r--src/libmpg123/mpglib.h6
-rw-r--r--src/libmpg123/xine_decoder.c4
-rw-r--r--src/libspudec/spu_decoder_api.h6
-rw-r--r--src/xine-engine/events.h4
-rw-r--r--src/xine-engine/spu_decoder.h4
9 files changed, 68 insertions, 67 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index c26157d33..86c6ebeaa 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.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: demux_avi.c,v 1.71 2002/03/27 15:30:16 miguelfreitas Exp $
+ * $Id: demux_avi.c,v 1.72 2002/03/31 20:38:40 jcdutton Exp $
*
* demultiplexer for avi streams
*
@@ -740,7 +740,7 @@ static long AVI_read_video(demux_avi_t *this, avi_t *AVI, char *vidbuf,
return nr;
}
-static uint32_t get_audio_pts (demux_avi_t *this, int track, long posc, long posb) {
+static int64_t get_audio_pts (demux_avi_t *this, int track, long posc, long posb) {
if (this->avi->audio[track]->dwSampleSize==0)
return posc * (double) this->avi->audio[track]->dwScale_audio /
@@ -751,7 +751,7 @@ static uint32_t get_audio_pts (demux_avi_t *this, int track, long posc, long pos
this->avi->audio[track]->dwRate_audio * 90000.0;
}
-static uint32_t get_video_pts (demux_avi_t *this, long pos) {
+static int64_t get_video_pts (demux_avi_t *this, long pos) {
return pos * (double) this->avi->dwScale / this->avi->dwRate * 90000.0;
}
@@ -759,7 +759,7 @@ static uint32_t get_video_pts (demux_avi_t *this, long pos) {
static int demux_avi_next (demux_avi_t *this) {
int i;
buf_element_t *buf = NULL;
- uint32_t audio_pts, video_pts;
+ int64_t audio_pts, video_pts;
int do_read_video = 0;
if (this->avi->video_frames <= this->avi->video_posf)
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index 90b58bead..3104335dc 100644
--- a/src/demuxers/demux_mpeg_block.c
+++ b/src/demuxers/demux_mpeg_block.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: demux_mpeg_block.c,v 1.83 2002/03/24 19:23:47 jcdutton Exp $
+ * $Id: demux_mpeg_block.c,v 1.84 2002/03/31 20:38:40 jcdutton Exp $
*
* demultiplexer for mpeg 1/2 program streams
*
@@ -85,7 +85,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
uint8_t *p;
int bMpeg1=0;
uint32_t header_len;
- int64_t PTS;
+ int64_t pts;
uint32_t packet_len;
uint32_t stream_id;
int64_t scr = this->last_scr;
@@ -395,21 +395,21 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
packet_len -=2;
}
- PTS = 0;
+ pts = 0;
if ((p[0] & 0xf0) == 0x20) {
- PTS = (p[ 0] & 0x0E) << 29 ;
- PTS |= p[ 1] << 22 ;
- PTS |= (p[ 2] & 0xFE) << 14 ;
- PTS |= p[ 3] << 7 ;
- PTS |= (p[ 4] & 0xFE) >> 1 ;
+ pts = (p[ 0] & 0x0E) << 29 ;
+ pts |= p[ 1] << 22 ;
+ pts |= (p[ 2] & 0xFE) << 14 ;
+ pts |= p[ 3] << 7 ;
+ pts |= (p[ 4] & 0xFE) >> 1 ;
p += 5;
packet_len -=5;
} else if ((p[0] & 0xf0) == 0x30) {
- PTS = (p[ 0] & 0x0E) << 29 ;
- PTS |= p[ 1] << 22 ;
- PTS |= (p[ 2] & 0xFE) << 14 ;
- PTS |= p[ 3] << 7 ;
- PTS |= (p[ 4] & 0xFE) >> 1 ;
+ pts = (p[ 0] & 0x0E) << 29 ;
+ pts |= p[ 1] << 22 ;
+ pts |= (p[ 2] & 0xFE) << 14 ;
+ pts |= p[ 3] << 7 ;
+ pts |= (p[ 4] & 0xFE) >> 1 ;
/* DTS decoding code is working, but not used in xine
DTS = (p[ 5] & 0x0E) << 29 ;
DTS |= p[ 6] << 22 ;
@@ -434,20 +434,20 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
this->warned = 1;
}
- if (p[7] & 0x80) { /* PTS avail */
+ if (p[7] & 0x80) { /* pts avail */
- PTS = (p[ 9] & 0x0E) << 29 ;
- PTS |= p[10] << 22 ;
- PTS |= (p[11] & 0xFE) << 14 ;
- PTS |= p[12] << 7 ;
- PTS |= (p[13] & 0xFE) >> 1 ;
+ pts = (p[ 9] & 0x0E) << 29 ;
+ pts |= p[10] << 22 ;
+ pts |= (p[11] & 0xFE) << 14 ;
+ pts |= p[12] << 7 ;
+ pts |= (p[13] & 0xFE) >> 1 ;
#ifdef LOG
- printf ("demux_mpeg_block: pts = %lld\n", PTS);
+ printf ("demux_mpeg_block: pts = %lld\n", pts);
#endif
} else
- PTS = 0;
+ pts = 0;
/* code is working but not used in xine
if (p[7] & 0x40) {
@@ -481,7 +481,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
buf->content = p+1;
buf->size = packet_len-1;
buf->type = BUF_SPU_PACKAGE + spu_id;
- buf->pts = PTS;
+ buf->pts = pts;
buf->input_pos = this->input->get_current_pos(this->input);
this->video_fifo->put (this->video_fifo, buf);
@@ -502,7 +502,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
} else {
buf->type = BUF_AUDIO_A52 + track;
}
- buf->pts = PTS;
+ buf->pts = pts;
buf->input_pos = this->input->get_current_pos(this->input);
@@ -562,7 +562,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
buf->content = p+pcm_offset;
buf->size = packet_len-pcm_offset;
buf->type = BUF_AUDIO_LPCM_BE + track;
- buf->pts = PTS;
+ buf->pts = pts;
buf->input_pos = this->input->get_current_pos(this->input);
@@ -579,7 +579,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
buf->content = p;
buf->size = packet_len;
buf->type = BUF_VIDEO_MPEG;
- buf->pts = PTS;
+ buf->pts = pts;
buf->input_pos = this->input->get_current_pos(this->input);
@@ -595,7 +595,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
buf->content = p;
buf->size = packet_len;
buf->type = BUF_AUDIO_MPEG + track;
- buf->pts = PTS;
+ buf->pts = pts;
buf->input_pos = this->input->get_current_pos(this->input);
@@ -664,7 +664,7 @@ static int demux_mpeg_block_estimate_rate (demux_mpeg_block_t *this) {
int is_mpeg1=0;
off_t pos, last_pos;
off_t step;
- int64_t PTS, last_PTS;
+ int64_t pts, last_pts;
int rate;
int count;
int stream_id;
@@ -674,7 +674,7 @@ static int demux_mpeg_block_estimate_rate (demux_mpeg_block_t *this) {
return 0;
last_pos = 0;
- last_PTS = 0;
+ last_pts = 0;
rate = 0;
step = this->input->get_length (this->input) / 10;
step = (step / this->blocksize) * this->blocksize;
@@ -711,7 +711,7 @@ static int demux_mpeg_block_estimate_rate (demux_mpeg_block_t *this) {
}
stream_id = p[3];
- PTS = 0;
+ pts = 0;
if ((stream_id < 0xbc) || ((stream_id & 0xf0) != 0xe0)) {
pos += (off_t) this->blocksize;
@@ -735,47 +735,47 @@ static int demux_mpeg_block_estimate_rate (demux_mpeg_block_t *this) {
}
if ( ((p[0] & 0xf0) == 0x20) || ((p[0] & 0xf0) == 0x30) ) {
- PTS = (p[ 0] & 0x0E) << 29 ;
- PTS |= p[ 1] << 22 ;
- PTS |= (p[ 2] & 0xFE) << 14 ;
- PTS |= p[ 3] << 7 ;
- PTS |= (p[ 4] & 0xFE) >> 1 ;
+ pts = (p[ 0] & 0x0E) << 29 ;
+ pts |= p[ 1] << 22 ;
+ pts |= (p[ 2] & 0xFE) << 14 ;
+ pts |= p[ 3] << 7 ;
+ pts |= (p[ 4] & 0xFE) >> 1 ;
}
}
} else { /* mpeg 2 */
- if (p[7] & 0x80) { /* PTS avail */
+ if (p[7] & 0x80) { /* pts avail */
- PTS = (p[ 9] & 0x0E) << 29 ;
- PTS |= p[10] << 22 ;
- PTS |= (p[11] & 0xFE) << 14 ;
- PTS |= p[12] << 7 ;
- PTS |= (p[13] & 0xFE) >> 1 ;
+ pts = (p[ 9] & 0x0E) << 29 ;
+ pts |= p[10] << 22 ;
+ pts |= (p[11] & 0xFE) << 14 ;
+ pts |= p[12] << 7 ;
+ pts |= (p[13] & 0xFE) >> 1 ;
} else
- PTS = 0;
+ pts = 0;
}
- if (PTS) {
+ if (pts) {
- if ( (pos>last_pos) && (PTS>last_PTS) ) {
+ if ( (pos>last_pos) && (pts>last_pts) ) {
int cur_rate;
- cur_rate = ((pos - last_pos)*90000) / ((PTS - last_PTS) * 50);
+ cur_rate = ((pos - last_pos)*90000) / ((pts - last_pts) * 50);
rate = (count * rate + cur_rate) / (count+1);
count ++;
/*
- printf ("demux_mpeg_block: stream_id %02x, pos: %lld, PTS: %d, cur_rate = %d, overall rate : %d\n",
- stream_id, pos, PTS, cur_rate, rate);
+ printf ("demux_mpeg_block: stream_id %02x, pos: %lld, pts: %d, cur_rate = %d, overall rate : %d\n",
+ stream_id, pos, pts, cur_rate, rate);
*/
}
last_pos = pos;
- last_PTS = PTS;
+ last_pts = pts;
pos += step;
} else
pos += (off_t) this->blocksize;
diff --git a/src/demuxers/demux_pes.c b/src/demuxers/demux_pes.c
index 9073b569b..cba5ee10a 100644
--- a/src/demuxers/demux_pes.c
+++ b/src/demuxers/demux_pes.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: demux_pes.c,v 1.21 2002/03/27 15:30:16 miguelfreitas Exp $
+ * $Id: demux_pes.c,v 1.22 2002/03/31 20:38:40 jcdutton Exp $
*
* demultiplexer for mpeg 2 PES (Packetized Elementary Streams)
* reads streams of variable blocksizes
@@ -112,7 +112,8 @@ static uint32_t read_bytes (demux_pes_t *this, int n) {
static void parse_mpeg2_packet (demux_pes_t *this, int nID) {
int nLen, i;
- uint32_t w, flags, header_len, pts;
+ uint32_t w, flags, header_len;
+ int64_t pts;
buf_element_t *buf = NULL;
nLen = read_bytes(this, 2);
diff --git a/src/libmpg123/interface.c b/src/libmpg123/interface.c
index 45c78c604..fccc19abe 100644
--- a/src/libmpg123/interface.c
+++ b/src/libmpg123/interface.c
@@ -18,7 +18,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: interface.c,v 1.5 2001/08/21 19:39:50 jcdutton Exp $
+ * $Id: interface.c,v 1.6 2002/03/31 20:38:41 jcdutton Exp $
*/
#include <stdlib.h>
@@ -78,7 +78,7 @@ int head_check(struct mpstr *mp)
}
void mpg_audio_decode_data (mpgaudio_t *mp, uint8_t *data, uint8_t *data_end,
- uint32_t pts)
+ int64_t pts)
{
while (1) {
diff --git a/src/libmpg123/mpglib.h b/src/libmpg123/mpglib.h
index 60014828f..54de6a5f3 100644
--- a/src/libmpg123/mpglib.h
+++ b/src/libmpg123/mpglib.h
@@ -18,7 +18,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: mpglib.h,v 1.6 2001/08/21 19:39:50 jcdutton Exp $
+ * $Id: mpglib.h,v 1.7 2002/03/31 20:38:41 jcdutton Exp $
*/
#ifndef HAVE_MPGLIB_H
@@ -51,7 +51,7 @@ typedef struct mpstr {
ao_instance_t *ao_output;
unsigned char osspace[8192];
- uint32_t pts;
+ int64_t pts;
} mpgaudio_t;
#ifndef BOOL
@@ -67,7 +67,7 @@ mpgaudio_t *mpg_audio_init (ao_instance_t *ao_output);
void mpg_audio_reset (mpgaudio_t *mp);
void mpg_audio_decode_data (mpgaudio_t *mp, uint8_t *data, uint8_t *data_end,
- uint32_t pts);
+ int64_t pts);
void mpg_audio_close (mpgaudio_t *mp);
diff --git a/src/libmpg123/xine_decoder.c b/src/libmpg123/xine_decoder.c
index 9721bfc8c..ea7cd9866 100644
--- a/src/libmpg123/xine_decoder.c
+++ b/src/libmpg123/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.6 2001/12/11 15:30:06 miguelfreitas Exp $
+ * $Id: xine_decoder.c,v 1.7 2002/03/31 20:38:41 jcdutton Exp $
*
* stuff needed to turn libmpg123 into a xine decoder plugin
*/
@@ -40,7 +40,7 @@
typedef struct mpgdec_decoder_s {
audio_decoder_t audio_decoder;
- uint32_t pts;
+ int64_t pts;
mpgaudio_t *mpg;
diff --git a/src/libspudec/spu_decoder_api.h b/src/libspudec/spu_decoder_api.h
index 17c9a992f..919457850 100644
--- a/src/libspudec/spu_decoder_api.h
+++ b/src/libspudec/spu_decoder_api.h
@@ -57,11 +57,11 @@ struct spu_decoder_s {
typedef struct spu_button_s spu_button_t;
struct spu_button_s {
uint32_t show;
- uint8_t color[4];
- uint8_t trans[4];
+ uint8_t color[4];
+ uint8_t trans[4];
uint16_t left, right;
uint16_t top, bottom;
- uint32_t pts;
+ int64_t pts;
uint32_t buttonN;
};
diff --git a/src/xine-engine/events.h b/src/xine-engine/events.h
index 8874fab3c..3ad501644 100644
--- a/src/xine-engine/events.h
+++ b/src/xine-engine/events.h
@@ -131,9 +131,9 @@ typedef struct {
*/
typedef struct {
xine_event_t event;
- uint8_t *buffer;
+ uint8_t *buffer;
uint32_t buf_len;
- uint32_t pts;
+ int64_t pts;
uint32_t scr;
} xine_closed_caption_event_t;
diff --git a/src/xine-engine/spu_decoder.h b/src/xine-engine/spu_decoder.h
index 108ec35ed..8a9c887be 100644
--- a/src/xine-engine/spu_decoder.h
+++ b/src/xine-engine/spu_decoder.h
@@ -19,7 +19,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: spu_decoder.h,v 1.4 2001/07/18 21:38:17 f1rmb Exp $
+ * $Id: spu_decoder.h,v 1.5 2002/03/31 20:38:43 jcdutton Exp $
*/
#ifndef HAVE_SPU_OUT_H
#define HAVE_SPU_OUT_H
@@ -77,7 +77,7 @@ struct spu_functions_s {
void (*write_spu_data)(spu_functions_t *this,
int16_t* spu_data, uint32_t num_samples,
- uint32_t pts);
+ int64_t pts);
/*
* this is called when the decoder no longer uses the spu