[FFmpeg-soc] [soc]: r4154 - libavfilter/vf_scale.c

stefano subversion at mplayerhq.hu
Wed Mar 4 01:03:07 CET 2009


Author: stefano
Date: Wed Mar  4 01:03:07 2009
New Revision: 4154

Log:
Use sscanf() for parsing the sws_opts string, simplify.

Modified:
   libavfilter/vf_scale.c

Modified: libavfilter/vf_scale.c
==============================================================================
--- libavfilter/vf_scale.c	Wed Mar  4 00:58:05 2009	(r4153)
+++ libavfilter/vf_scale.c	Wed Mar  4 01:03:07 2009	(r4154)
@@ -57,12 +57,7 @@ static av_cold int init(AVFilterContext 
 
     if ((p = strstr(sws_opts, "sws_flags="))) {
         char sws_flags[256];
-        int i = 0;
-        p = strchr(sws_opts, '=');
-        p++;
-        while (*p && *p != ':' && i < sizeof(sws_flags) - 1)
-            sws_flags[i++] = *p++;
-        sws_flags[i] = 0;
+        sscanf(p, "sws_flags=%255[^:]", sws_flags);
 
         if (av_set_string3(scale->sws, "sws_flags", sws_flags, 1, NULL) < 0) {
             sws_freeContext(scale->sws);



More information about the FFmpeg-soc mailing list