]> git.sesse.net Git - ffmpeg/blobdiff - cmdutils.c
build: add rules to generate preprocessed source files
[ffmpeg] / cmdutils.c
index 657096852606b2b35084741c9f619b3698d40a9b..2329120c57537ca7bc9e8d794c921951f82b442f 100644 (file)
@@ -371,7 +371,10 @@ int opt_default(void *optctx, const char *opt, const char *arg)
     const AVOption *o;
     char opt_stripped[128];
     const char *p;
-    const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(), *sc = sws_get_class();
+    const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
+#if CONFIG_SWSCALE
+    const AVClass *sc = sws_get_class();
+#endif
 
     if (!(p = strchr(opt, ':')))
         p = opt + strlen(opt);
@@ -385,6 +388,7 @@ int opt_default(void *optctx, const char *opt, const char *arg)
     else if ((o = av_opt_find(&fc, opt, NULL, 0,
                               AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))
         av_dict_set(&format_opts, opt, arg, FLAGS);
+#if CONFIG_SWSCALE
     else if ((o = av_opt_find(&sc, opt, NULL, 0,
                               AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
         // XXX we only support sws_flags, not arbitrary sws options
@@ -394,6 +398,7 @@ int opt_default(void *optctx, const char *opt, const char *arg)
             return ret;
         }
     }
+#endif
 
     if (o)
         return 0;
@@ -1317,7 +1322,9 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu
      */
     memset(buf->base[0], 128, ret);
 
-    avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
+    av_pix_fmt_get_chroma_sub_sample(s->pix_fmt,
+                                     &h_chroma_shift, &v_chroma_shift);
+
     for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) {
         const int h_shift = i==0 ? 0 : h_chroma_shift;
         const int v_shift = i==0 ? 0 : v_chroma_shift;