* @data: data to parse (starting from, and including, the sync code)
* @length: size of @data in bytes
* @res: PESHeader to fill (only valid with #PES_PARSING_OK.
- * @offset: Offset in @data to the data to parse. If #PES_PARSING_OK, offset to
- * first byte of data after the header.
*
* Parses the mpeg-ts PES header located in @data into the @res.
*
* is needed to properly parse the header.
*/
PESParsingResult
-mpegts_parse_pes_header (const guint8 * data, gsize length, PESHeader * res,
- gint * offset)
+mpegts_parse_pes_header (const guint8 * data, gsize length, PESHeader * res)
{
PESParsingResult ret = PES_PARSING_NEED_MORE;
gsize origlength = length;
guint8 val8, flags;
g_return_val_if_fail (res != NULL, PES_PARSING_BAD);
- g_return_val_if_fail (offset != NULL, PES_PARSING_BAD);
- g_return_val_if_fail (*offset < length, PES_PARSING_BAD);
-
- data += *offset;
- length -= *offset;
/* The smallest valid PES header is 6 bytes (prefix + stream_id + length) */
if (G_UNLIKELY (length < 6))
origlength, length);
res->header_size = origlength - length;
- *offset += res->header_size;
ret = PES_PARSING_OK;
return ret;
const guint8* stream_id_extension_data;
} PESHeader;
-G_GNUC_INTERNAL PESParsingResult mpegts_parse_pes_header (const guint8* data, gsize size,
- PESHeader *res, gint *offset);
+G_GNUC_INTERNAL PESParsingResult mpegts_parse_pes_header (const guint8* data,
+ gsize size,
+ PESHeader *res);
G_GNUC_INTERNAL void init_pes_parser (void);
G_END_DECLS
guint8 * data, guint32 length, guint64 bufferoffset)
{
PESHeader header;
- gint offset = 0;
PESParsingResult parseres;
GST_MEMDUMP ("Header buffer", data, MIN (length, 32));
- parseres = mpegts_parse_pes_header (data, length, &header, &offset);
+ parseres = mpegts_parse_pes_header (data, length, &header);
if (G_UNLIKELY (parseres == PES_PARSING_NEED_MORE))
goto discont;
if (G_UNLIKELY (parseres == PES_PARSING_BAD)) {