if (level != AV_LOG_QUIET &&
((level <= AV_LOG_INFO) || (tvhlog_options & TVHLOG_OPT_LIBAV))) {
- class_name = av_default_item_name(ptr);
+ class_name = ptr ? av_default_item_name(ptr) : "";
l1 = strlen(fmt);
l2 = strlen(class_name);
return;
strcpy(fmt1, class_name);
- strcat(fmt1, ": ");
+ if (class_name[0])
+ strcat(fmt1, ": ");
strcat(fmt1, fmt);
/* remove trailing newline */
const char *source_name, const char *source_args,
const char *filters, const char *sink_name, ...)
{
+ static const AVClass logclass = {
+ .class_name = "TVHGraph",
+ .version = 1,
+ };
+ struct {
+ const AVClass *class;
+ } logctx = { &logclass };
AVFilter *iavflt = NULL, *oavflt = NULL;
AVFilterInOut *iavfltio = NULL, *oavfltio = NULL;
AVBufferSrcParameters *par = NULL;
avfilter_graph_set_auto_convert(self->avfltgraph,
AVFILTER_AUTO_CONVERT_NONE);
- if ((ret = avfilter_graph_config(self->avfltgraph, NULL)) < 0) {
+ if ((ret = avfilter_graph_config(self->avfltgraph, &logctx)) < 0) {
tvh_context_log(self, LOG_ERR, "filters: failed to config filter graph");
}