diff options
author | Edward Hervey <edward@collabora.com> | 2013-08-14 10:33:14 +0200 |
---|---|---|
committer | Edward Hervey <edward@collabora.com> | 2013-08-14 10:33:14 +0200 |
commit | 5208b8a05074ebdb0da835c29b95f8eb6001cb0e (patch) | |
tree | 43673e0912cc633120dcef6154b1915c2e512799 /gst/mpegtsdemux | |
parent | 0bd6f374c8b527fb0efa25c583af3714cf08cc5b (diff) | |
download | gstreamer-plugins-bad-5208b8a05074ebdb0da835c29b95f8eb6001cb0e.tar.gz |
pesparse: Remove unused argument
We always provided 0 as the offset and never used the returned value.
Based on feedback from Stas Sergeev <stsp@list.ru>
https://bugzilla.gnome.org/show_bug.cgi?id=657343
Diffstat (limited to 'gst/mpegtsdemux')
-rw-r--r-- | gst/mpegtsdemux/pesparse.c | 11 | ||||
-rw-r--r-- | gst/mpegtsdemux/pesparse.h | 5 | ||||
-rw-r--r-- | gst/mpegtsdemux/tsdemux.c | 3 |
3 files changed, 5 insertions, 14 deletions
diff --git a/gst/mpegtsdemux/pesparse.c b/gst/mpegtsdemux/pesparse.c index 28150a136..258badcbe 100644 --- a/gst/mpegtsdemux/pesparse.c +++ b/gst/mpegtsdemux/pesparse.c @@ -37,8 +37,6 @@ GST_DEBUG_CATEGORY_STATIC (pes_parser_debug); * @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. * @@ -47,8 +45,7 @@ GST_DEBUG_CATEGORY_STATIC (pes_parser_debug); * 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; @@ -57,11 +54,6 @@ mpegts_parse_pes_header (const guint8 * data, gsize length, PESHeader * res, 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)) @@ -377,7 +369,6 @@ done_parsing: origlength, length); res->header_size = origlength - length; - *offset += res->header_size; ret = PES_PARSING_OK; return ret; diff --git a/gst/mpegtsdemux/pesparse.h b/gst/mpegtsdemux/pesparse.h index 54417cf12..694e802b8 100644 --- a/gst/mpegtsdemux/pesparse.h +++ b/gst/mpegtsdemux/pesparse.h @@ -190,8 +190,9 @@ typedef struct { 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 diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 608927698..5f94af766 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -1254,12 +1254,11 @@ gst_ts_demux_parse_pes_header (GstTSDemux * demux, TSDemuxStream * stream, 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)) { |