This makes the function more flexible and allows using it in more places. --- libavcodec/avcodec.h | 13 +++++++++++-- libavcodec/utils.c | 16 ++++------------ 2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index df4e617..ddf8cd6 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -4299,9 +4299,18 @@ void av_log_missing_feature(void *avc, const char *feature, int want_sample); * only, and would normally not be used by applications. * @param[in] avc a pointer to an arbitrary struct of which the first field is * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message + * @param[in] msg format string containing an optional message, or NULL if no message */ -void av_log_ask_for_sample(void *avc, const char *msg); +//void av_log_ask_for_sample(void *avc, const char *msg, ...); + +#define av_log_ask_for_sample(context, msg ...) \ + if (msg) \ + av_log(context, AV_LOG_WARNING, msg); \ + av_log(context, AV_LOG_WARNING, "If you want to help, upload a sample " \ + "of this file to ftp://upload.libav.org/incoming/ " \ + "and contact the libav-devel mailing list.\n"); \ + + /** * Register the hardware accelerator hwaccel. diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 6d31254..9eb2dcd 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1193,19 +1193,11 @@ void av_log_missing_feature(void *avc, const char *feature, int want_sample) "version to the newest one from Git. If the problem still " "occurs, it means that your file has a feature which has not " "been implemented.", feature); - if(want_sample) - av_log_ask_for_sample(avc, NULL); - else + if (want_sample) { + av_log_ask_for_sample(avc, ""); + } else { av_log(avc, AV_LOG_WARNING, "\n"); -} - -void av_log_ask_for_sample(void *avc, const char *msg) -{ - if (msg) - av_log(avc, AV_LOG_WARNING, "%s ", msg); - av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample " - "of this file to ftp://upload.libav.org/incoming/ " - "and contact the libav-devel mailing list.\n"); + } } static AVHWAccel *first_hwaccel = NULL; -- 1.5.6.5 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
