[FFmpeg-devel] [PATCH] print message if probe failed due to probe conflict

Reimar Döffinger Reimar.Doeffinger
Fri Sep 25 14:11:38 CEST 2009


If two probe functions return the same value, it is a bit hard to find
out which ones were involved and broke things.
So I propose this:
Index: libavformat/utils.c
===================================================================
--- libavformat/utils.c (revision 20013)
+++ libavformat/utils.c (working copy)
@@ -287,6 +287,8 @@
 static AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)
 {
     AVInputFormat *fmt1, *fmt;
+    AVInputFormat *conflict_fmt1 = NULL, *conflict_fmt2 = NULL;
+    int conflict_score = -1;
     int score;
 
     fmt = NULL;
@@ -304,9 +306,18 @@
         if (score > *score_max) {
             *score_max = score;
             fmt = fmt1;
-        }else if (score == *score_max)
+        }else if (score == *score_max) {
+            if (fmt) {
+                conflict_fmt1 = fmt;
+                conflict_fmt2 = fmt1;
+                conflict_score = score;
+            }
             fmt = NULL;
+        }
     }
+    if (conflict_score > 0)
+        av_log(NULL, AV_LOG_WARNING, "No format match due to probe conflict between %s and %s with score %i\n",
+               conflict_fmt1->name, conflict_fmt2->name, conflict_score);
     return fmt;
 }
 




More information about the ffmpeg-devel mailing list