[dvblast-devel] [PATCH] dvb/pes: Fix for PES payload offset
Vladimir Yakovlev
nagos at inbox.ru
Fri Sep 14 23:32:57 CEST 2012
In pes_payload was not accounted size of optional header,
only for actual data in PES_data_packet_header_length.
---
mpeg/pes.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mpeg/pes.h b/mpeg/pes.h
index 98a45f8..7aba4d4 100644
--- a/mpeg/pes.h
+++ b/mpeg/pes.h
@@ -49,6 +49,7 @@ extern "C"
#define PES_HEADER_SIZE_NOPTS 9
#define PES_HEADER_SIZE_PTS 14
#define PES_HEADER_SIZE_PTSDTS 19
+#define PES_HEADER_OPTIONAL_SIZE 3
#define PES_STREAM_ID_MIN 0xbc
#define PES_STREAM_ID_PRIVATE_1 0xbd
@@ -131,7 +132,7 @@ static inline bool pes_validate(const uint8_t *p_pes)
*****************************************************************************/
static inline uint8_t *pes_payload(uint8_t *p_pes)
{
- return p_pes + PES_HEADER_SIZE + pes_get_headerlength(p_pes);
+ return p_pes + PES_HEADER_SIZE + PES_HEADER_OPTIONAL_SIZE + pes_get_headerlength(p_pes);
}
#ifdef __cplusplus
--
1.7.9.5
More information about the dvblast-devel
mailing list