All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pcm: 2nd round of pcm_misc DSD fixes
@ 2014-08-15  6:43 Jurgen Kramer
  2014-08-15  9:02 ` Alexander E. Patrakov
  0 siblings, 1 reply; 3+ messages in thread
From: Jurgen Kramer @ 2014-08-15  6:43 UTC (permalink / raw)
  To: alsa-devel; +Cc: Jurgen Kramer

Functions 'snd_pcm_format_silence_64' and 'snd_pcm_format_size' also need to be
able to handle the DSD formats.

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
---
 src/pcm/pcm_misc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/pcm/pcm_misc.c b/src/pcm/pcm_misc.c
index 24d52f9..c52e7bf 100644
--- a/src/pcm/pcm_misc.c
+++ b/src/pcm/pcm_misc.c
@@ -317,11 +317,13 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
 	switch (format) {
 	case SNDRV_PCM_FORMAT_S8:
 	case SNDRV_PCM_FORMAT_U8:
+	case SNDRV_PCM_FORMAT_DSD_U8:
 		return samples;
 	case SNDRV_PCM_FORMAT_S16_LE:
 	case SNDRV_PCM_FORMAT_S16_BE:
 	case SNDRV_PCM_FORMAT_U16_LE:
 	case SNDRV_PCM_FORMAT_U16_BE:
+	case SNDRV_PCM_FORMAT_DSD_U16_LE:
 		return samples * 2;
 	case SNDRV_PCM_FORMAT_S18_3LE:
 	case SNDRV_PCM_FORMAT_S18_3BE:
@@ -387,6 +389,8 @@ u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
 	case SNDRV_PCM_FORMAT_S20_3BE:
 	case SNDRV_PCM_FORMAT_S18_3LE:
 	case SNDRV_PCM_FORMAT_S18_3BE:
+	case SNDRV_PCM_FORMAT_DSD_U8:
+	case SNDRV_PCM_FORMAT_DSD_U16_LE:
 		return 0;
 	case SNDRV_PCM_FORMAT_U8:
 		return 0x8080808080808080ULL;
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-15 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15  6:43 [PATCH] pcm: 2nd round of pcm_misc DSD fixes Jurgen Kramer
2014-08-15  9:02 ` Alexander E. Patrakov
2014-08-15 15:40   ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.