[FFmpeg-soc] [soc]: r4058 - libavfilter/vf_format.c

stefano subversion at mplayerhq.hu
Mon Feb 16 22:03:55 CET 2009


Author: stefano
Date: Mon Feb 16 22:03:55 2009
New Revision: 4058

Log:
Simplify/factorize init(), making the case "last name in the list" to
be treated in the same loop as the case "not last name in the list".

Modified:
   libavfilter/vf_format.c

Modified: libavfilter/vf_format.c
==============================================================================
--- libavfilter/vf_format.c	Mon Feb 16 21:58:33 2009	(r4057)
+++ libavfilter/vf_format.c	Mon Feb 16 22:03:55 2009	(r4058)
@@ -38,10 +38,10 @@ static av_cold int init(AVFilterContext 
     int fmt, len;
 
     /* parse the list of formats */
-    for(cur = args; cur; cur = sep) {
+    for(cur = args; cur; cur = sep ? sep+1 : NULL) {
         if(!(sep = strchr(cur, ':')))
-            fmt = avcodec_get_pix_fmt(cur);
-        else {
+            len = strlen(cur);
+        else
             len = sep - cur;
             if(len >= 32) {
                 av_log(ctx, AV_LOG_ERROR, "format name too long\n");
@@ -50,8 +50,6 @@ static av_cold int init(AVFilterContext 
             memcpy(name, cur, len);
             name[len] = 0;
             fmt = avcodec_get_pix_fmt(name);
-            sep ++;
-        }
 
         if(fmt == PIX_FMT_NONE) {
             av_log(ctx, AV_LOG_ERROR, "unknown pixel format\n");



More information about the FFmpeg-soc mailing list