summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/pes.c14
-rw-r--r--tools/pes.h4
-rw-r--r--tools/ts.c10
3 files changed, 15 insertions, 13 deletions
diff --git a/tools/pes.c b/tools/pes.c
index ef80b3a3..14773f2e 100644
--- a/tools/pes.c
+++ b/tools/pes.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: pes.c,v 1.9 2009-02-16 16:03:18 phintuka Exp $
+ * $Id: pes.c,v 1.10 2009-07-01 09:31:17 phintuka Exp $
*
*/
@@ -25,9 +25,9 @@ int64_t pes_get_pts(const uint8_t *buf, int len)
if (IS_VIDEO_PACKET(buf) || IS_AUDIO_PACKET(buf)) {
if ((buf[6] & 0xC0) != 0x80)
- return INT64_C(-1);
+ return NO_PTS;
if ((buf[6] & 0x30) != 0)
- return INT64_C(-1);
+ return NO_PTS;
if ((len > 13) && (buf[7] & 0x80)) { /* pts avail */
int64_t pts;
@@ -39,7 +39,7 @@ int64_t pes_get_pts(const uint8_t *buf, int len)
return pts;
}
}
- return INT64_C(-1);
+ return NO_PTS;
}
int64_t pes_get_dts(const uint8_t *buf, int len)
@@ -47,9 +47,9 @@ int64_t pes_get_dts(const uint8_t *buf, int len)
if (IS_VIDEO_PACKET(buf) || IS_AUDIO_PACKET(buf)) {
if ((buf[6] & 0xC0) != 0x80)
- return INT64_C(-1);
+ return NO_PTS;
if ((buf[6] & 0x30) != 0)
- return INT64_C(-1);
+ return NO_PTS;
if (len > 18 && (buf[7] & 0x40)) { /* dts avail */
int64_t dts;
@@ -61,7 +61,7 @@ int64_t pes_get_dts(const uint8_t *buf, int len)
return dts;
}
}
- return INT64_C(-1);
+ return NO_PTS;
}
void pes_change_pts(uint8_t *buf, int len, int64_t new_pts)
diff --git a/tools/pes.h b/tools/pes.h
index 94e9cff8..bd6be7c9 100644
--- a/tools/pes.h
+++ b/tools/pes.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: pes.h,v 1.11 2009-02-16 16:03:18 phintuka Exp $
+ * $Id: pes.h,v 1.12 2009-07-01 09:31:17 phintuka Exp $
*
*/
@@ -24,6 +24,8 @@ extern "C" {
#define MAX_SCR ((int64_t)0x1ffffffffLL)
+#define NO_PTS (INT64_C(-1))
+
/* PES PIDs */
#define PRIVATE_STREAM1 0xBD
#define PADDING_STREAM 0xBE
diff --git a/tools/ts.c b/tools/ts.c
index 637d34ef..4fafbb03 100644
--- a/tools/ts.c
+++ b/tools/ts.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: ts.c,v 1.9 2009-06-29 15:47:44 phintuka Exp $
+ * $Id: ts.c,v 1.10 2009-07-01 09:31:17 phintuka Exp $
*
*/
@@ -483,17 +483,17 @@ int ts_parse_pmt (pmt_data_t *pmt, uint program_no, const uint8_t *pkt)
int64_t ts_get_pcr(const uint8_t *pkt)
{
if (!ts_ADAPT_FIELD_EXISTS(pkt)) {
- return INT64_C(-1);
+ return NO_PTS;
}
if (ts_HAS_ERROR(pkt)) {
LOGMSG("ts_get_pcr: transport error");
- return INT64_C(-1);
+ return NO_PTS;
}
/* pcr flag ? */
if (! (pkt[5] & 0x10))
- return INT64_C(-1);
+ return NO_PTS;
int64_t pcr;
uint epcr;
@@ -642,7 +642,7 @@ static int ts_get_pes(ts_state_t *ts, const uint8_t *data)
int64_t ts_get_pts(ts_state_t *ts, const uint8_t *data)
{
- int64_t pts = INT64_C(-1);
+ int64_t pts = NO_PTS;
int cnt = ts_get_pes(ts, data);
if (cnt > 14) {