diff --git a/doc/APIchanges b/doc/APIchanges
index 7fadab30eb32898d7ea52435c01dc1713736db7c..e3ae4e87e1beb5128f410e89ad23e77e1c436385 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2014-08-09
 
 API changes, most recent first:
 
+2014-10-02 - xxxxxxx - lavu 54.8.100 - avstring.h
+  Add av_match_list()
+
 2014-09-24 - xxxxxxx - libpostproc 53.1.100
   Add visualization support
 
diff --git a/libavformat/format.c b/libavformat/format.c
index 1026c8f7a72dd672351385dee2c3aa290a398d0a..2d56e6d545378c722b922bf0f63750ed14d14218 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -80,28 +80,14 @@ void av_register_output_format(AVOutputFormat *format)
 
 int av_match_ext(const char *filename, const char *extensions)
 {
-    const char *ext, *p;
-    char ext1[32], *q;
+    const char *ext;
 
     if (!filename)
         return 0;
 
     ext = strrchr(filename, '.');
-    if (ext) {
-        ext++;
-        p = extensions;
-        for (;;) {
-            q = ext1;
-            while (*p != '\0' && *p != ','  && q - ext1 < sizeof(ext1) - 1)
-                *q++ = *p++;
-            *q = '\0';
-            if (!av_strcasecmp(ext1, ext))
-                return 1;
-            if (*p == '\0')
-                break;
-            p++;
-        }
-    }
+    if (ext)
+        return av_match_list(ext + 1, extensions, ',');
     return 0;
 }
 
diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index fd010e407c1a8b30892041b70a79edb57982d3a4..ac7f98ae74b044f0abbadb655f92a29ece1d981b 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -402,6 +402,27 @@ end:
     return ret;
 }
 
+int av_match_list(const char *name, const char *list, char separator)
+{
+    const char *p;
+    char ext1[128], *q;
+    int i;
+
+    p = list;
+    for (i = 1;; i++) {
+        q = ext1;
+        while (*p != '\0' && *p != separator  && q - ext1 < sizeof(ext1) - 1)
+            *q++ = *p++;
+        *q = '\0';
+        if (!av_strcasecmp(ext1, name))
+            return i;
+        if (*p == '\0')
+            break;
+        p++;
+    }
+    return 0;
+}
+
 #ifdef TEST
 
 int main(void)
diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index 616c0662fc433bdc149098125bbc95a08b70442c..ea7d1dcb43bffa53d456f9817d87c1d407b4b72c 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -357,6 +357,13 @@ int av_escape(char **dst, const char *src, const char *special_chars,
 int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end,
                    unsigned int flags);
 
+/**
+ * Check if a name is in a list.
+ * @returns 0 if not found, or the 1 based index where it has been found in the
+ *            list.
+ */
+int av_match_list(const char *name, const char *list, char separator);
+
 /**
  * @}
  */
diff --git a/libavutil/version.h b/libavutil/version.h
index 14242f9b1cb79219ff85a482c3e92958f98eba39..9e138b5fabe42f17c479ad5821802c2eac0b7a38 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,8 +56,8 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  54
-#define LIBAVUTIL_VERSION_MINOR   7
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MINOR   8
+#define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \