]> git.alsa-project.org Git - alsa-utils.git/commitdiff
S/PDIF related changes..
authorJaroslav Kysela <perex@perex.cz>
Thu, 21 Dec 2000 21:53:07 +0000 (21:53 +0000)
committerJaroslav Kysela <perex@perex.cz>
Thu, 21 Dec 2000 21:53:07 +0000 (21:53 +0000)
alsactl/alsactl.c
aplay/aplay.c

index 2e437e0b3302328a97747f7ea8578ec1cbdd565d..c63759c3b1fedde79ba401065bf5a5f0850f288a 100644 (file)
@@ -309,22 +309,30 @@ static int get_control(snd_ctl_t *handle, snd_control_id_t *id, snd_config_t *to
                }
        }
 
-       if (info.type == SND_CONTROL_TYPE_BYTES) {
-               char buf[info.values_count * 2 + 1];
-               char *p = buf;
-               char *hex = "0123456789abcdef";
-               for (idx = 0; idx < info.values_count; idx++) {
-                       int v = ctl.value.bytes.data[idx];
-                       *p++ = hex[v >> 4];
-                       *p++ = hex[v & 0x0f];
-               }
-               *p = '\0';
-               err = snd_config_string_add(control, "value", buf);
-               if (err < 0) {
-                       error("snd_config_string_add: %s", snd_strerror(err));
-                       return err;
+       switch (info.type) {
+       case SND_CONTROL_TYPE_BYTES:
+               {
+                       char buf[info.values_count * 2 + 1];
+                       char *p = buf;
+                       char *hex = "0123456789abcdef";
+                       for (idx = 0; idx < info.values_count; idx++) {
+                               int v = ctl.value.bytes.data[idx];
+                               *p++ = hex[v >> 4];
+                               *p++ = hex[v & 0x0f];
+                       }
+                       *p = '\0';
+                       err = snd_config_string_add(control, "value", buf);
+                       if (err < 0) {
+                               error("snd_config_string_add: %s", snd_strerror(err));
+                               return err;
+                       }
+                       return 0;
                }
+       case SND_CONTROL_TYPE_IEC958:
+               error("An IEC958 control ignored");
                return 0;
+       default:
+               break;
        }
 
        if (info.values_count == 1) {
@@ -823,7 +831,7 @@ static int set_control(snd_ctl_t *handle, snd_config_t *control)
                                error("bad control.%d.value.%d content", numid, idx);
                                return -EINVAL;
                        }
-                       ctl.value.integer.value[idx] = val;
+                       ctl.value.bytes.data[idx] = val;
                        break;
                default:
                        break;
index 35e5ee03351d3992d352bbc6c2a263e34ab6fe87..fe9b1afc97302e299c0032c8b348754262e91234 100644 (file)
@@ -86,7 +86,6 @@ static int verbose = 0;
 static int buffer_pos = 0;
 static size_t bits_per_sample, bits_per_frame;
 static size_t buffer_bytes;
-int digital = SND_PCM_DIG_NONE;
 
 static int count;
 static int vocmajor, vocminor;
@@ -404,10 +403,10 @@ int main(int argc, char *argv[])
                        interleaved = 0;
                        break;
                case 'C':
-                       digital = SND_PCM_DIG_AES_IEC958C;
+                       // digital = SND_PCM_DIG_AES_IEC958C;
                        break;
                case 'P':
-                       digital = SND_PCM_DIG_AES_IEC958P;
+                       // digital = SND_PCM_DIG_AES_IEC958P;
                        break;
                default:
                        fprintf(stderr, "Try `%s --help' for more information.\n", command);
@@ -421,6 +420,9 @@ int main(int argc, char *argv[])
                return 1;
        }
 
+#if 1
+#warning "The S/PDIF code needs to be recoded.."
+#else
        if (digital != SND_PCM_DIG_NONE) {
                snd_pcm_dig_params_t dig;
                memset(&dig, 0, sizeof(dig));
@@ -443,6 +445,7 @@ int main(int argc, char *argv[])
                        return 1;
                }
        }
+#endif
 
        if (nonblock) {
                err = snd_pcm_nonblock(handle, 1);