[FFmpeg-devel] [PATCH] avformat/img2dec: Attempt to detect non-escaped glob patterns too (-pattern_type glob)

Alexander Strasser eclipse7 at gmx.net
Sun Oct 5 03:42:32 CEST 2014


Fixes ticket #3948

Based-on-patch-by: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>
---

- fixes the \0 typo in the string literal
- cosmetic change to the score comment
- remove the -pattern_type comment because as the
  options matching system works now it would not
  be the "ideal" solution I think
  (I tried to explain why in #ffmpeg-devel)

  Alexander


 libavformat/img2dec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 5aac555..a06933d 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -162,6 +162,8 @@ static int img_read_probe(AVProbeData *p)
             return AVPROBE_SCORE_MAX;
         else if (is_glob(p->filename))
             return AVPROBE_SCORE_MAX;
+        else if (p->filename[strcspn(p->filename, "*?{")]) // probably PT_GLOB
+            return AVPROBE_SCORE_EXTENSION + 2; // score choosen to be a tad above the image pipes
         else if (p->buf_size == 0)
             return 0;
         else if (av_match_ext(p->filename, "raw") || av_match_ext(p->filename, "gif"))
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141005/8e2fefcf/attachment.asc>


More information about the ffmpeg-devel mailing list