#include "libavutil/avassert.h"
#include "libavutil/buffer.h"
#include "libavutil/common.h"
+#include "libavutil/opt.h"
#include "cbs.h"
#include "cbs_internal.h"
av_freep(&ctx);
return AVERROR(ENOMEM);
}
+ if (type->priv_class) {
+ *(const AVClass **)ctx->priv_data = type->priv_class;
+ av_opt_set_defaults(ctx->priv_data);
+ }
}
ctx->decompose_unit_types = NULL;
ctx->codec->close(ctx);
av_freep(&ctx->write_buffer);
+
+ if (ctx->codec->priv_class && ctx->priv_data)
+ av_opt_free(ctx->priv_data);
+
av_freep(&ctx->priv_data);
av_freep(ctx_ptr);
}
av_log(ctx->log_ctx, AV_LOG_VERBOSE,
"Decomposition unimplemented for unit %d "
"(type %"PRIu32").\n", i, unit->type);
+ } else if (err == AVERROR(EAGAIN)) {
+ av_log(ctx->log_ctx, AV_LOG_VERBOSE,
+ "Skipping decomposition of unit %d "
+ "(type %"PRIu32").\n", i, unit->type);
+ av_buffer_unref(&unit->content_ref);
+ unit->content = NULL;
} else if (err < 0) {
av_log(ctx->log_ctx, AV_LOG_ERROR, "Failed to read unit %d "
"(type %"PRIu32").\n", i, unit->type);