From 8d9dc05245c3dd92cd8f1c2c2866dc7d9988490e Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Thu, 14 Nov 2013 01:53:31 -0300 Subject: [PATCH] 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 --- gst/typefind/gsttypefindfunctions.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.7.4