summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2007-09-17 22:34:11 +0000
committerphintuka <phintuka>2007-09-17 22:34:11 +0000
commitc5c349b581f701291a0ec8c5ae2dbc304410563e (patch)
tree43703f0af37c50c5888dd2a9a7accda774d0188f
parent843411627224df7f9affa5083c5241276c0eb50e (diff)
downloadxineliboutput-c5c349b581f701291a0ec8c5ae2dbc304410563e.tar.gz
xineliboutput-c5c349b581f701291a0ec8c5ae2dbc304410563e.tar.bz2
PES DTS parsing
-rw-r--r--xine_input_vdr.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/xine_input_vdr.c b/xine_input_vdr.c
index 93bf02fc..608a2b0d 100644
--- a/xine_input_vdr.c
+++ b/xine_input_vdr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_input_vdr.c,v 1.97 2007-09-17 22:33:09 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.98 2007-09-17 22:34:11 phintuka Exp $
*
*/
@@ -905,8 +905,8 @@ static char *unescape_filename(const char *fn)
static int64_t pts_from_pes(const uint8_t *buf, int size)
{
- int64_t pts = -1;
- if(size > 13 && buf[7] & 0x80) { /* pts avail */
+ int64_t pts = INT64_C(-1);
+ if(size > 13 && (buf[7] & 0x80)) { /* pts avail */
pts = ((int64_t)( buf[ 9] & 0x0E)) << 29;
pts |= (int64_t)( buf[10] << 22 );
pts |= (int64_t)((buf[11] & 0xFE) << 14 );
@@ -916,6 +916,19 @@ static int64_t pts_from_pes(const uint8_t *buf, int size)
return pts;
}
+static int64_t dts_from_pes(const uint8_t *buf, int size)
+{
+ int64_t dts = INT64_C(-1);
+ if(size > 18 && (buf[7] & 0x40)) { /* dts avail */
+ dts = ((int64_t)( buf[14] & 0x0E)) << 29 ;
+ dts |= (int64_t)( buf[15] << 22 );
+ dts |= (int64_t)((buf[16] & 0xFE) << 14 );
+ dts |= (int64_t)( buf[17] << 7 );
+ dts |= (int64_t)((buf[18] & 0xFE) >> 1 );
+ }
+ return dts;
+}
+
static void pes_strip_pts(uint8_t *buf, int size)
{
if(size > 13 && buf[7] & 0x80) { /* pts avail */