From 380d83f9a968da60419e0afbd8b37bd50ba953de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:33:10 +0100 Subject: [chore]: Bump github.com/abema/go-mp4 from 0.13.0 to 1.0.0 (#2222) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../abema/go-mp4/internal/util/string.go | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 vendor/github.com/abema/go-mp4/internal/util/string.go (limited to 'vendor/github.com/abema/go-mp4/internal/util/string.go') diff --git a/vendor/github.com/abema/go-mp4/internal/util/string.go b/vendor/github.com/abema/go-mp4/internal/util/string.go new file mode 100644 index 000000000..b38251bb3 --- /dev/null +++ b/vendor/github.com/abema/go-mp4/internal/util/string.go @@ -0,0 +1,42 @@ +package util + +import ( + "strconv" + "strings" + "unicode" +) + +func FormatSignedFixedFloat1616(val int32) string { + if val&0xffff == 0 { + return strconv.Itoa(int(val >> 16)) + } else { + return strconv.FormatFloat(float64(val)/(1<<16), 'f', 5, 64) + } +} + +func FormatUnsignedFixedFloat1616(val uint32) string { + if val&0xffff == 0 { + return strconv.Itoa(int(val >> 16)) + } else { + return strconv.FormatFloat(float64(val)/(1<<16), 'f', 5, 64) + } +} + +func FormatSignedFixedFloat88(val int16) string { + if val&0xff == 0 { + return strconv.Itoa(int(val >> 8)) + } else { + return strconv.FormatFloat(float64(val)/(1<<8), 'f', 3, 32) + } +} + +func EscapeUnprintable(r rune) rune { + if unicode.IsGraphic(r) { + return r + } + return rune('.') +} + +func EscapeUnprintables(src string) string { + return strings.Map(EscapeUnprintable, src) +} -- cgit v1.2.3