[FFmpeg-cvslog] lavf/concatdec: allow probing.

Nicolas George git at videolan.org
Wed Feb 13 15:04:24 CET 2013


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sun Feb  3 10:27:11 2013 +0100| [b68dd8a1614b1230ab8ee9f6a4d01aa64a8d9ea3] | committer: Nicolas George

lavf/concatdec: allow probing.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b68dd8a1614b1230ab8ee9f6a4d01aa64a8d9ea3
---

 doc/demuxers.texi       |    6 ++++--
 libavformat/concatdec.c |    3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 2867538..e4c358c 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -44,8 +44,6 @@ length.
 
 All files must have the same streams (same codecs, same time base, etc.).
 
-This script format can currently not be probed, it must be specified explicitly.
-
 @subsection Syntax
 
 The script is a text file in extended-ASCII, with one directive per line.
@@ -62,6 +60,10 @@ backslash or single quotes.
 Identify the script type and version. It also sets the @option{safe} option
 to 1 if it was to its default -1.
 
+To make FFmpeg recognize the format automatically, this directive must
+appears exactly as is (no extra space or byte-order-mark) on the very first
+line of the script.
+
 @end table
 
 @subsection Options
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index b99ec5c..f1fb169 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -40,7 +40,8 @@ typedef struct {
 
 static int concat_probe(AVProbeData *probe)
 {
-    return 0;
+    return memcmp(probe->buf, "ffconcat version 1.0", 20) ?
+           0 : AVPROBE_SCORE_MAX;
 }
 
 static char *get_keyword(uint8_t **cursor)



More information about the ffmpeg-cvslog mailing list