From f188a023c78b9d0bf1684b912f0cc227ebc66298 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 12 Aug 2015 03:00:15 +1000 Subject: [PATCH] typefind: Make the H.264 typefind a tiny bit more lenient. When we see prefix NALs before a Subset SPS has been spotted, it might just be because the stream was truncated at the start, so don't count those as either 'bad' or 'good' packets. --- gst/typefind/gsttypefindfunctions.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index ebb5260f73..7c58e1f8b9 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -2668,8 +2668,12 @@ h264_video_type_find (GstTypeFind * tf, gpointer unused) if (nut == 15) { seen_ssps = TRUE; good++; - } else if (seen_ssps && (nut == 14 || nut == 20)) { - good++; + } else if (nut == 14 || nut == 20) { + /* Sometimes we see NAL 14 or 20 without SSPS + * if dropped into the middle of a stream - + * just ignore those (don't add to bad count) */ + if (seen_ssps) + good++; } else { /* reserved */ /* Theoretically these are good, since if they exist in the