Merge "initialize pcm_config to zero"
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h
index 809e02d..1554b52 100644
--- a/include/tinyalsa/asoundlib.h
+++ b/include/tinyalsa/asoundlib.h
@@ -93,17 +93,20 @@
unsigned int period_count;
enum pcm_format format;
- /* Values to use for the ALSA start, stop and silence thresholds. Setting
- * any one of these values to 0 will cause the default tinyalsa values to be
- * used instead. Tinyalsa defaults are as follows.
+ /* Values to use for the ALSA start, stop and silence thresholds, and
+ * silence size. Setting any one of these values to 0 will cause the
+ * default tinyalsa values to be used instead.
+ * Tinyalsa defaults are as follows.
*
* start_threshold : period_count * period_size
* stop_threshold : period_count * period_size
* silence_threshold : 0
+ * silence_size : 0
*/
unsigned int start_threshold;
unsigned int stop_threshold;
unsigned int silence_threshold;
+ unsigned int silence_size;
/* Minimum number of frames available before pcm_mmap_write() will actually
* write into the kernel buffer. Only used if the stream is opened in mmap mode
diff --git a/mixer.c b/mixer.c
index 4568cca..9aa2eb2 100644
--- a/mixer.c
+++ b/mixer.c
@@ -360,6 +360,11 @@
source = ev.value.bytes.data;
break;
+ case SNDRV_CTL_ELEM_TYPE_IEC958:
+ size = sizeof(ev.value.iec958);
+ source = &ev.value.iec958;
+ break;
+
default:
return -EINVAL;
}
@@ -427,6 +432,11 @@
dest = ev.value.bytes.data;
break;
+ case SNDRV_CTL_ELEM_TYPE_IEC958:
+ size = sizeof(ev.value.iec958);
+ dest = &ev.value.iec958;
+ break;
+
default:
return -EINVAL;
}
diff --git a/pcm.c b/pcm.c
index d8af58a..e3a41b0 100644
--- a/pcm.c
+++ b/pcm.c
@@ -953,8 +953,8 @@
sparams.avail_min = config->avail_min;
sparams.xfer_align = config->period_size / 2; /* needed for old kernels */
- sparams.silence_size = 0;
sparams.silence_threshold = config->silence_threshold;
+ sparams.silence_size = config->silence_size;
pcm->boundary = sparams.boundary = pcm->buffer_size;
while (pcm->boundary * 2 <= INT_MAX - pcm->buffer_size)