typefind: Make the H.264 typefind a tiny bit more lenient.
authorJan Schmidt <jan@centricular.com>
Tue, 11 Aug 2015 17:00:15 +0000 (03:00 +1000)
committerJan Schmidt <jan@centricular.com>
Sat, 15 Aug 2015 02:14:56 +0000 (12:14 +1000)
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

index ebb5260f73dac8bc142fca7bc9c9c215129cf7c9..7c58e1f8b9a97fcc33560d644117b60d9258b0e2 100644 (file)
@@ -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