diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2014-03-21 17:07:19 +0100 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2014-03-24 18:09:27 +0100 |
commit | 1b421808175ab96bf6fd22ccddb49837c152a72c (patch) | |
tree | 28293743dfdc81e76c82dd2ffdba5a277ad8d4be /gst-libs/gst/codecparsers/gsth264parser.c | |
parent | aa73624638b89a76b3a6d44cbb5353edc86feaac (diff) | |
download | gstreamer-plugins-bad-1b421808175ab96bf6fd22ccddb49837c152a72c.tar.gz |
codecparsers: h264: fix skipping of unsupported SEI messages.
The payloadSize does not account for emulation prevention bytes. So,
just use nal_reader_skip() for skipping payload_size bits. It should
be possible to further optimize this code since the NAL reader shall
be aligned to byte boundary already.
Kill the now unused nal_reader_skip_to_next_byte() function.
https://bugzilla.gnome.org/show_bug.cgi?id=726829
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'gst-libs/gst/codecparsers/gsth264parser.c')
-rw-r--r-- | gst-libs/gst/codecparsers/gsth264parser.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c index 63312d666..99f083554 100644 --- a/gst-libs/gst/codecparsers/gsth264parser.c +++ b/gst-libs/gst/codecparsers/gsth264parser.c @@ -882,10 +882,14 @@ gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser, res = gst_h264_parser_parse_pic_timing (nalparser, &sei->payload.pic_timing, nr); } else { - /* Just consume payloadSize */ - guint32 i; - for (i = 0; i < payloadSize; i++) - nal_reader_skip_to_next_byte (nr); + /* Just consume payloadSize bytes, which does not account for + emulation prevention bytes */ + guint nbits = payload_size % 8; + while (payload_size > 0) { + nal_reader_skip (nr, nbits); + payload_size -= nbits; + nbits = 8; + } res = GST_H264_PARSER_OK; } |