summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2015-08-12 03:00:15 +1000
committerJan Schmidt <jan@centricular.com>2015-08-15 12:14:56 +1000
commitf188a023c78b9d0bf1684b912f0cc227ebc66298 (patch)
tree2ee1cc080cd029f051f5089d19cb0d0e00c7dea4
parent897371ac4fb75e5d334702341dc641a0e96f26a2 (diff)
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.
-rw-r--r--gst/typefind/gsttypefindfunctions.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c
index ebb5260f7..7c58e1f8b 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