Commit bf6fb563 authored by Gavin Kinsey's avatar Gavin Kinsey Committed by Michael Niedermayer

Allow building of command line utils without swresample lib

This allows building ffprobe without swresample
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f5af8d5e
...@@ -69,7 +69,9 @@ void init_opts(void) ...@@ -69,7 +69,9 @@ void init_opts(void)
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC, sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
NULL, NULL, NULL); NULL, NULL, NULL);
#endif #endif
#if CONFIG_SWRESAMPLE
swr_opts = swr_alloc(); swr_opts = swr_alloc();
#endif
} }
void uninit_opts(void) void uninit_opts(void)
...@@ -78,7 +80,9 @@ void uninit_opts(void) ...@@ -78,7 +80,9 @@ void uninit_opts(void)
sws_freeContext(sws_opts); sws_freeContext(sws_opts);
sws_opts = NULL; sws_opts = NULL;
#endif #endif
#if CONFIG_SWRESAMPLE
swr_free(&swr_opts); swr_free(&swr_opts);
#endif
av_dict_free(&format_opts); av_dict_free(&format_opts);
av_dict_free(&codec_opts); av_dict_free(&codec_opts);
} }
...@@ -449,6 +453,7 @@ int opt_default(const char *opt, const char *arg) ...@@ -449,6 +453,7 @@ int opt_default(const char *opt, const char *arg)
} }
} }
#endif #endif
#if CONFIG_SWRESAMPLE
swr_class = swr_get_class(); swr_class = swr_get_class();
if (!oc && !of && !os && (oswr = av_opt_find(&swr_class, opt, NULL, 0, if (!oc && !of && !os && (oswr = av_opt_find(&swr_class, opt, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
...@@ -458,6 +463,7 @@ int opt_default(const char *opt, const char *arg) ...@@ -458,6 +463,7 @@ int opt_default(const char *opt, const char *arg)
return ret; return ret;
} }
} }
#endif
if (oc || of || os || oswr) if (oc || of || os || oswr)
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment