Update of /cvsroot/alsa/alsa-tools/ac3dec
In directory sc8-pr-cvs1:/tmp/cvs-serv1638

Modified Files:
        ac3spdif.c output.c 
Log Message:
Fixed big-endian support

Index: ac3spdif.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/ac3dec/ac3spdif.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ac3spdif.c  6 Aug 2001 16:08:01 -0000       1.3
+++ ac3spdif.c  8 Jan 2003 11:30:04 -0000       1.4
@@ -154,7 +154,7 @@
         done_banner = 1;
       }
       
-#ifndef WORDS_BIGENDIAN
+#ifndef _a_b_c_d_e_f /* WORDS_BIGENDIAN */
       // extract_ac3 seems to write swabbed data
       swab(&buf[10], &buf[10], syncinfo.frame_size * 2 - 2);
 #endif

Index: output.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/ac3dec/output.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- output.c    22 Oct 2002 18:01:16 -0000      1.17
+++ output.c    8 Jan 2003 11:30:04 -0000       1.18
@@ -41,6 +41,7 @@
        char devstr[128];
        snd_pcm_hw_params_t *params;
        unsigned int rate, buffer_time, period_time, tmp;
+       snd_pcm_format_t format = output->bits == 16 ? SND_PCM_FORMAT_S16 : 
+SND_PCM_FORMAT_U8;
        int err, step;
        snd_pcm_hw_params_alloca(&params);
 
@@ -76,6 +77,7 @@
                                sprintf(devstr, 
"iec958:AES0=0x%x,AES1=0x%x,AES2=0x%x,AES3=0x%x", s[0], s[1], s[2], s[3]);
                                if (out_config.card)
                                        sprintf(devstr + strlen(devstr), ",CARD=%s", 
out_config.card);
+                               format = SND_PCM_FORMAT_S16_LE;
                        } else {
                                if (out_config.card)
                                        sprintf(devstr, "plughw:%s", out_config.card);
@@ -114,29 +116,29 @@
        err = snd_pcm_hw_params_set_access(pcm, params,
                                           SND_PCM_ACCESS_RW_INTERLEAVED);
        if (err < 0) {
-               fprintf(stderr, "Access type not available");
+               fprintf(stderr, "Access type not available\n");
                goto __close;
        }
-       err = snd_pcm_hw_params_set_format(pcm, params, output->bits == 16 ? 
SND_PCM_FORMAT_S16_LE : SND_PCM_FORMAT_U8);
+       err = snd_pcm_hw_params_set_format(pcm, params, format);
        if (err < 0) {
-               fprintf(stderr, "Sample format non available");
+               fprintf(stderr, "Sample format non available\n");
                goto __close;
        }
        err = snd_pcm_hw_params_set_channels(pcm, params, output->channels);
        if (err < 0) {
-               fprintf(stderr, "Channels count non available");
+               fprintf(stderr, "Channels count non available\n");
                goto __close;
        }
        rate = output->rate;
        err = snd_pcm_hw_params_set_rate_near(pcm, params, &rate, 0);
        if (err < 0) {
-               fprintf(stderr, "Rate not available");
+               fprintf(stderr, "Rate not available\n");
                goto __close;
        }
        buffer_time = 500000;
        err = snd_pcm_hw_params_set_buffer_time_near(pcm, params, &buffer_time, 0);
        if (err < 0) {
-               fprintf(stderr, "Buffer time not available");
+               fprintf(stderr, "Buffer time not available\n");
                goto __close;
        }
        step = 2;
@@ -146,7 +148,7 @@
                tmp = period_time;
                err = snd_pcm_hw_params_set_period_time_near(pcm, params, &tmp, 0);
                if (err < 0) {
-                       fprintf(stderr, "Period time not available");
+                       fprintf(stderr, "Period time not available\n");
                        goto __close;
                }
                if (tmp == period_time) {



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to