From 7a1b996da930caff0305b8bda6fe19ae3109ebd7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Mar 2023 18:30:01 +0100 Subject: [PATCH] pcm/Dsd2Pcm: use SampleTraits::SILENCE --- src/pcm/Dsd2Pcm.cxx | 7 +------ src/pcm/Traits.hxx | 10 ++++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/pcm/Dsd2Pcm.cxx b/src/pcm/Dsd2Pcm.cxx index 05bc09e08..ca2227940 100644 --- a/src/pcm/Dsd2Pcm.cxx +++ b/src/pcm/Dsd2Pcm.cxx @@ -172,14 +172,9 @@ void Dsd2Pcm::Reset() noexcept { /* my favorite silence pattern */ - fifo.fill(0x69); + fifo.fill(SampleTraits::SILENCE); fifopos = 0; - /* 0x69 = 01101001 - * This pattern "on repeat" makes a low energy 352.8 kHz tone - * and a high energy 1.0584 MHz tone which should be filtered - * out completely by any playback system --> silence - */ } inline void diff --git a/src/pcm/Traits.hxx b/src/pcm/Traits.hxx index 21fb4c09b..06b3c13d5 100644 --- a/src/pcm/Traits.hxx +++ b/src/pcm/Traits.hxx @@ -1,8 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright The Music Player Daemon Project -#ifndef MPD_PCM_TRAITS_HXX -#define MPD_PCM_TRAITS_HXX +#pragma once #include "SampleFormat.hxx" @@ -150,7 +149,10 @@ struct SampleTraits { static constexpr size_t SAMPLE_SIZE = sizeof(value_type); + /* 0x69 = 01101001 + * This pattern "on repeat" makes a low energy 352.8 kHz tone + * and a high energy 1.0584 MHz tone which should be filtered + * out completely by any playback system --> silence + */ static constexpr value_type SILENCE = 0x69; }; - -#endif