
Upstream libfmt commit fmtlib/fmt@d707292 now requires the format function to be const. Adjust the function prototype so it is const and can compile. Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
24 lines
509 B
C++
24 lines
509 B
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
// Copyright The Music Player Daemon Project
|
|
|
|
#pragma once
|
|
|
|
extern "C" {
|
|
#include <libavutil/samplefmt.h>
|
|
}
|
|
|
|
#include <fmt/format.h>
|
|
|
|
template<>
|
|
struct fmt::formatter<AVSampleFormat> : formatter<string_view>
|
|
{
|
|
template<typename FormatContext>
|
|
auto format(const AVSampleFormat format, FormatContext &ctx) const {
|
|
const char *name = av_get_sample_fmt_name(format);
|
|
if (name == nullptr)
|
|
name = "?";
|
|
|
|
return formatter<string_view>::format(name, ctx);
|
|
}
|
|
};
|