From: Reynaldo H. Verdejo Pinochet Date: Thu, 14 Nov 2013 04:53:31 +0000 (-0300) Subject: typefind: Fix identification of some MPEG files X-Git-Tag: 1.3.1~376 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d9dc05245c3dd92cd8f1c2c2866dc7d9988490e;p=platform%2Fupstream%2Fgst-plugins-base.git typefind: Fix identification of some MPEG files Make sure we begin by peeking at MPEG2_MAX_PROBE_LENGTH bytes. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=678011 --- diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 5126efb..14c679a 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -2178,10 +2178,13 @@ mpeg_sys_type_find (GstTypeFind * tf, gpointer unused) gint len; len = MPEG2_MAX_PROBE_LENGTH; - do { - len = len / 2; + + while (len >= 16) { data = gst_type_find_peek (tf, 0, 5 + len); - } while (data == NULL && len >= 32); + if (data != NULL) + break; + len = len / 2; + } if (!data) return;