From 012c40140f827e3708c34cca3de569eeca14d38e Mon Sep 17 00:00:00 2001 From: Zhao Halley Date: Tue, 6 Dec 2011 08:17:38 +0800 Subject: [PATCH] codecparsers: fix < 0 issue of guint in mpeg4 parser gst_byte_reader_masked_scan_uint32 returns a guint, not a gint, which explains the issue we sometime get using < 0 instead of == -1; --- gst-libs/gst/codecparsers/gstmpeg4parser.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/codecparsers/gstmpeg4parser.c b/gst-libs/gst/codecparsers/gstmpeg4parser.c index 09c522bebd..30774e408e 100644 --- a/gst-libs/gst/codecparsers/gstmpeg4parser.c +++ b/gst-libs/gst/codecparsers/gstmpeg4parser.c @@ -379,7 +379,7 @@ gst_mpeg4_next_resync (GstMpeg4Packet * packet, off1 = gst_byte_reader_masked_scan_uint32 (&br, mask, pattern, 0, size); - if (off1 < 0) + if (off1 == -1) return GST_MPEG4_PARSER_NO_PACKET; GST_DEBUG ("Resync code found at %i", off1); @@ -391,7 +391,7 @@ gst_mpeg4_next_resync (GstMpeg4Packet * packet, off2 = gst_byte_reader_masked_scan_uint32 (&br, mask, pattern, off1, size - off1); - if (off2 < 0) + if (off2 == -1) return GST_MPEG4_PARSER_NO_PACKET_END; packet->size = off1 - off2; @@ -451,7 +451,7 @@ gst_mpeg4_parse (GstMpeg4Packet * packet, gboolean skip_user_data, off1 = gst_byte_reader_masked_scan_uint32 (&br, 0xffffff00, 0x00000100, offset, size - offset); - if (off1 < 0) { + if (off1 == -1) { GST_DEBUG ("No start code prefix in this buffer"); return GST_MPEG4_PARSER_NO_PACKET; } @@ -471,7 +471,7 @@ find_end: off2 = gst_byte_reader_masked_scan_uint32 (&br, 0xffffff00, 0x00000100, off1 + 4, size - off1 - 4); - if (off2 < 0) { + if (off2 == -1) { GST_DEBUG ("Packet start %d, No end found", off1 + 4); packet->size = G_MAXUINT; @@ -519,7 +519,7 @@ gst_h263_parse (GstMpeg4Packet * packet, off1 = find_psc (&br); - if (off1 < 0) { + if (off1 == -1) { GST_DEBUG ("No start code prefix in this buffer"); return GST_MPEG4_PARSER_NO_PACKET; } @@ -529,7 +529,7 @@ gst_h263_parse (GstMpeg4Packet * packet, off2 = find_psc (&br); - if (off2 < 0) { + if (off2 == -1) { GST_DEBUG ("Packet start %d, No end found", off1); packet->size = G_MAXUINT;