summaryrefslogtreecommitdiff
path: root/src/demuxers
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers')
-rw-r--r--src/demuxers/demux_mpeg.c20
-rw-r--r--src/demuxers/demux_mpeg_block.c24
-rw-r--r--src/demuxers/demux_mpeg_pes.c14
-rw-r--r--src/demuxers/demux_pva.c4
4 files changed, 31 insertions, 31 deletions
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index f480608a2..090c6783c 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_mpeg.c,v 1.144 2004/10/18 21:55:00 tmattern Exp $
+ * $Id: demux_mpeg.c,v 1.145 2004/12/17 20:08:44 miguelfreitas Exp $
*
* demultiplexer for mpeg 1/2 program streams
* reads streams of variable blocksizes
@@ -263,7 +263,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
if ((flags & 0x80) == 0x80) {
w = read_bytes(this, 1);
- pts = (w & 0x0e) << 29 ;
+ pts = (int64_t)(w & 0x0e) << 29 ;
w = read_bytes(this, 2);
pts |= (w & 0xFFFE) << 14;
w = read_bytes(this, 2);
@@ -422,7 +422,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
if ((flags & 0x80) == 0x80) {
w = read_bytes(this, 1);
- pts = (w & 0x0e) << 29 ;
+ pts = (int64_t)(w & 0x0e) << 29 ;
w = read_bytes(this, 2);
pts |= (w & 0xFFFE) << 14;
w = read_bytes(this, 2);
@@ -480,7 +480,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
if ((flags & 0x80) == 0x80) {
w = read_bytes(this, 1);
- pts = (w & 0x0e) << 29 ;
+ pts = (int64_t)(w & 0x0e) << 29 ;
w = read_bytes(this, 2);
pts |= (w & 0xFFFE) << 14;
w = read_bytes(this, 2);
@@ -492,7 +492,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
if ((flags & 0x40) == 0x40) {
w = read_bytes(this, 1);
- dts = (w & 0x0e) << 29 ;
+ dts = (int64_t)(w & 0x0e) << 29 ;
w = read_bytes(this, 2);
dts |= (w & 0xFFFE) << 14;
w = read_bytes(this, 2);
@@ -583,7 +583,7 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
if (this->status != DEMUX_OK)
return;
- pts = (w & 0xe) << 29 ;
+ pts = (int64_t)(w & 0xe) << 29 ;
w = read_bytes(this, 2); len -= 2;
pts |= (w & 0xFFFE) << 14;
@@ -598,7 +598,7 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
if (this->status != DEMUX_OK)
return;
- pts = (w & 0x0e) << 29 ;
+ pts = (int64_t)(w & 0x0e) << 29 ;
w = read_bytes(this, 2); len -= 2;
pts |= (w & 0xFFFE) << 14;
@@ -608,7 +608,7 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
pts |= (w & 0xFFFE) >> 1;
w = read_bytes(this, 1); len -= 1;
- dts = (w & 0x0e) << 29 ;
+ dts = (int64_t)(w & 0x0e) << 29 ;
w = read_bytes(this, 2); len -= 2;
dts |= (w & 0xFFFE) << 14;
w = read_bytes(this, 2); len -= 2;
@@ -727,7 +727,7 @@ static uint32_t parse_pack(demux_mpeg_t *this) {
/* system_clock_reference */
- scr = (buf & 0x38) << 27;
+ scr = (int64_t)(buf & 0x38) << 27;
scr |= (buf & 0x03) << 28;
buf = read_bytes (this, 1);
scr |= buf << 20;
@@ -765,7 +765,7 @@ static uint32_t parse_pack(demux_mpeg_t *this) {
/* system_clock_reference */
- scr = (buf & 0x2) << 30;
+ scr = (int64_t)(buf & 0x2) << 30;
buf = read_bytes (this, 2);
scr |= (buf & 0xFFFE) << 14;
buf = read_bytes (this, 2);
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index e068d4826..c4f72830a 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.209 2004/07/11 10:43:01 mroi Exp $
+ * $Id: demux_mpeg_block.c,v 1.210 2004/12/17 20:08:45 miguelfreitas Exp $
*
* demultiplexer for mpeg 1/2 program streams
* used with fixed blocksize devices (like dvd/vcd)
@@ -421,7 +421,7 @@ static int32_t parse_program_stream_pack_header(demux_mpeg_block_t *this, uint8_
if (this->mpeg1) {
/* system_clock_reference */
- this->scr = (p[4] & 0x02) << 30;
+ this->scr = (int64_t)(p[4] & 0x02) << 30;
this->scr |= (p[5] & 0xFF) << 22;
this->scr |= (p[6] & 0xFE) << 14;
this->scr |= (p[7] & 0xFF) << 7;
@@ -445,7 +445,7 @@ static int32_t parse_program_stream_pack_header(demux_mpeg_block_t *this, uint8_
/* system_clock_reference */
- this->scr = (p[4] & 0x08) << 27 ;
+ this->scr = (int64_t)(p[4] & 0x08) << 27 ;
this->scr |= (p[4] & 0x03) << 28 ;
this->scr |= p[5] << 20;
this->scr |= (p[6] & 0xF8) << 12 ;
@@ -489,12 +489,12 @@ static int32_t parse_private_stream_2(demux_mpeg_block_t *this, uint8_t *p, buf_
/* NAV Packet */
this->packet_len = p[4] << 8 | p[5];
- start_pts = (p[7+12] << 24);
+ start_pts = ((int64_t)p[7+12] << 24);
start_pts |= (p[7+13] << 16);
start_pts |= (p[7+14] << 8);
start_pts |= p[7+15];
- end_pts = (p[7+16] << 24);
+ end_pts = ((int64_t)p[7+16] << 24);
end_pts |= (p[7+17] << 16);
end_pts |= (p[7+18] << 8);
end_pts |= p[7+19];
@@ -598,7 +598,7 @@ static int32_t parse_pes_for_pts(demux_mpeg_block_t *this, uint8_t *p, buf_eleme
this->dts = 0;
if ((p[0] & 0xf0) == 0x20) {
- this->pts = (p[ 0] & 0x0E) << 29 ;
+ this->pts = (int64_t)(p[ 0] & 0x0E) << 29 ;
this->pts |= p[ 1] << 22 ;
this->pts |= (p[ 2] & 0xFE) << 14 ;
this->pts |= p[ 3] << 7 ;
@@ -608,13 +608,13 @@ static int32_t parse_pes_for_pts(demux_mpeg_block_t *this, uint8_t *p, buf_eleme
this->packet_len -=5;
return header_len;
} else if ((p[0] & 0xf0) == 0x30) {
- this->pts = (p[ 0] & 0x0E) << 29 ;
+ this->pts = (int64_t)(p[ 0] & 0x0E) << 29 ;
this->pts |= p[ 1] << 22 ;
this->pts |= (p[ 2] & 0xFE) << 14 ;
this->pts |= p[ 3] << 7 ;
this->pts |= (p[ 4] & 0xFE) >> 1 ;
- this->dts = (p[ 5] & 0x0E) << 29 ;
+ this->dts = (int64_t)(p[ 5] & 0x0E) << 29 ;
this->dts |= p[ 6] << 22 ;
this->dts |= (p[ 7] & 0xFE) << 14 ;
this->dts |= p[ 8] << 7 ;
@@ -657,7 +657,7 @@ static int32_t parse_pes_for_pts(demux_mpeg_block_t *this, uint8_t *p, buf_eleme
if (p[7] & 0x80) { /* pts avail */
- this->pts = (p[ 9] & 0x0E) << 29 ;
+ this->pts = (int64_t)(p[ 9] & 0x0E) << 29 ;
this->pts |= p[10] << 22 ;
this->pts |= (p[11] & 0xFE) << 14 ;
this->pts |= p[12] << 7 ;
@@ -670,7 +670,7 @@ static int32_t parse_pes_for_pts(demux_mpeg_block_t *this, uint8_t *p, buf_eleme
if (p[7] & 0x40) { /* dts avail */
- this->dts = (p[14] & 0x0E) << 29 ;
+ this->dts = (int64_t)(p[14] & 0x0E) << 29 ;
this->dts |= p[15] << 22 ;
this->dts |= (p[16] & 0xFE) << 14 ;
this->dts |= p[17] << 7 ;
@@ -1111,7 +1111,7 @@ 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 = (int64_t)(p[ 0] & 0x0E) << 29 ;
pts |= p[ 1] << 22 ;
pts |= (p[ 2] & 0xFE) << 14 ;
pts |= p[ 3] << 7 ;
@@ -1122,7 +1122,7 @@ static int demux_mpeg_block_estimate_rate (demux_mpeg_block_t *this) {
if (p[7] & 0x80) { /* pts avail */
- pts = (p[ 9] & 0x0E) << 29 ;
+ pts = (int64_t)(p[ 9] & 0x0E) << 29 ;
pts |= p[10] << 22 ;
pts |= (p[11] & 0xFE) << 14 ;
pts |= p[12] << 7 ;
diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c
index 345a60d4e..8ac3b6c82 100644
--- a/src/demuxers/demux_mpeg_pes.c
+++ b/src/demuxers/demux_mpeg_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_mpeg_pes.c,v 1.27 2004/07/20 16:21:26 mroi Exp $
+ * $Id: demux_mpeg_pes.c,v 1.28 2004/12/17 20:08:46 miguelfreitas Exp $
*
* demultiplexer for mpeg 2 PES (Packetized Elementary Streams)
* reads streams of variable blocksizes
@@ -476,7 +476,7 @@ static int32_t parse_program_stream_pack_header(demux_mpeg_pes_t *this, uint8_t
if (this->mpeg1) {
/* system_clock_reference */
- this->scr = (p[4] & 0x02) << 30;
+ this->scr = (int64_t)(p[4] & 0x02) << 30;
this->scr |= (p[5] & 0xFF) << 22;
this->scr |= (p[6] & 0xFE) << 14;
this->scr |= (p[7] & 0xFF) << 7;
@@ -501,7 +501,7 @@ static int32_t parse_program_stream_pack_header(demux_mpeg_pes_t *this, uint8_t
/* system_clock_reference */
- this->scr = (p[4] & 0x08) << 27 ;
+ this->scr = (int64_t)(p[4] & 0x08) << 27 ;
this->scr |= (p[4] & 0x03) << 28 ;
this->scr |= p[5] << 20;
this->scr |= (p[6] & 0xF8) << 12 ;
@@ -555,12 +555,12 @@ static int32_t parse_private_stream_2(demux_mpeg_pes_t *this, uint8_t *p, buf_el
/* NAV Packet */
- start_pts = (p[7+12] << 24);
+ start_pts = ((int64_t)p[7+12] << 24);
start_pts |= (p[7+13] << 16);
start_pts |= (p[7+14] << 8);
start_pts |= p[7+15];
- end_pts = (p[7+16] << 24);
+ end_pts = ((int64_t)p[7+16] << 24);
end_pts |= (p[7+17] << 16);
end_pts |= (p[7+18] << 8);
end_pts |= p[7+19];
@@ -1193,7 +1193,7 @@ static int demux_mpeg_pes_estimate_rate (demux_mpeg_pes_t *this) {
}
if ( ((p[0] & 0xf0) == 0x20) || ((p[0] & 0xf0) == 0x30) ) {
- pts = (p[ 0] & 0x0E) << 29 ;
+ pts = (int64_t)(p[ 0] & 0x0E) << 29 ;
pts |= p[ 1] << 22 ;
pts |= (p[ 2] & 0xFE) << 14 ;
pts |= p[ 3] << 7 ;
@@ -1204,7 +1204,7 @@ static int demux_mpeg_pes_estimate_rate (demux_mpeg_pes_t *this) {
if (p[7] & 0x80) { /* pts avail */
- pts = (p[ 9] & 0x0E) << 29 ;
+ pts = (int64_t)(p[ 9] & 0x0E) << 29 ;
pts |= p[10] << 22 ;
pts |= (p[11] & 0xFE) << 14 ;
pts |= p[12] << 7 ;
diff --git a/src/demuxers/demux_pva.c b/src/demuxers/demux_pva.c
index 687680513..4b4e13435 100644
--- a/src/demuxers/demux_pva.c
+++ b/src/demuxers/demux_pva.c
@@ -23,7 +23,7 @@
* For more information regarding the PVA file format, refer to this PDF:
* http://www.technotrend.de/download/av_format_v1.pdf
*
- * $Id: demux_pva.c,v 1.19 2004/06/13 21:28:54 miguelfreitas Exp $
+ * $Id: demux_pva.c,v 1.20 2004/12/17 20:08:47 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -233,7 +233,7 @@ static int demux_pva_send_chunk(demux_plugin_t *this_gen) {
return this->status;
}
- pts = (preamble[0] & 0x0e) << 29 ;
+ pts = (int64_t)(preamble[0] & 0x0e) << 29 ;
pts |= (BE_16(&preamble[1]) & 0xFFFE) << 14;
pts |= (BE_16(&preamble[3]) & 0xFFFE) >> 1;