diff options
author | phintuka <phintuka> | 2007-05-30 07:05:36 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2007-05-30 07:05:36 +0000 |
commit | 29771c6732790d1e1ed01b192010e4dd93d0d760 (patch) | |
tree | 1fc982d0a3c8bce148b9c5802170d8aa3d7c310b /xine_input_vdr.c | |
parent | 73c6cea6ffc89da43a786b91ad96d09a4b3cd9b7 (diff) | |
download | xineliboutput-29771c6732790d1e1ed01b192010e4dd93d0d760.tar.gz xineliboutput-29771c6732790d1e1ed01b192010e4dd93d0d760.tar.bz2 |
Fixed pes_strip_pts (packet and header lengths were not updated)
Diffstat (limited to 'xine_input_vdr.c')
-rw-r--r-- | xine_input_vdr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xine_input_vdr.c b/xine_input_vdr.c index 0ee21494..c5f66ce3 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.82 2007-05-17 17:36:26 phintuka Exp $ + * $Id: xine_input_vdr.c,v 1.83 2007-05-30 07:05:36 phintuka Exp $ * */ @@ -894,11 +894,16 @@ static int64_t pts_from_pes(const uint8_t *buf, int size) static void pes_strip_pts(uint8_t *buf, int size) { if(size > 13 && buf[7] & 0x80) { /* pts avail */ + int pes_len = (buf[4] << 8) | buf[5]; if ((buf[6] & 0xC0) != 0x80) return; if ((buf[6] & 0x30) != 0) return; - buf[7] &= ~0x80; /* clear pts flag */ + pes_len -= 5; /* update packet len */ + buf[4] = pes_len >> 8; /* packet len (hi) */ + buf[5] = pes_len & 0xff; /* packet len (lo) */ + buf[7] &= 0x7f; /* clear pts flag */ + buf[8] -= 5; /* update header len */ memmove(buf+9, buf+14, size-14); } } @@ -1416,6 +1421,7 @@ static buf_element_t *get_buf_element(vdr_input_plugin_t *this, int size, int fo buf->content = buf->mem; buf->size = 0; buf->type = BUF_DEMUX_BLOCK; + buf->pts = 0; buf->free_buffer = buffer_pool_free; } |