Update of /cvsroot/alsa/alsa-utils/aplay
In directory sc8-pr-cvs1:/tmp/cvs-serv18238

Modified Files:
        aplay.c 
Log Message:
Added snd_config_update_free_global() calls and 64-bit file offset support

Index: aplay.c
===================================================================
RCS file: /cvsroot/alsa/alsa-utils/aplay/aplay.c,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -r1.170 -r1.171
--- aplay.c     7 Aug 2003 14:48:17 -0000       1.170
+++ aplay.c     27 Aug 2003 11:08:27 -0000      1.171
@@ -334,6 +334,8 @@
        int do_device_list = 0, do_pcm_list = 0;
        snd_pcm_info_t *info;
 
+       snd_pcm_info_alloca(&info);
+
        err = snd_output_stdio_attach(&log, stderr, 0);
        assert(err >= 0);
 
@@ -488,9 +490,11 @@
        if (do_device_list) {
                if (do_pcm_list) pcm_list();
                device_list();
+               snd_config_update_free_global();
                return 0;
        } else if (do_pcm_list) {
                pcm_list();
+               snd_config_update_free_global();
                return 0;
        }
 
@@ -500,7 +504,6 @@
                return 1;
        }
 
-       snd_pcm_info_alloca(&info);
        if ((err = snd_pcm_info(handle, info)) < 0) {
                error("info error: %s", snd_strerror(err));
                return 1;
@@ -562,6 +565,7 @@
        snd_pcm_close(handle);
        free(audiobuf);
        snd_output_close(log);
+       snd_config_update_free_global();
        return EXIT_SUCCESS;
 }
 
@@ -1289,7 +1293,7 @@
        char was_extended = 0, output = 0;
        u_short *sp, repeat = 0;
        size_t silence;
-       int filepos = 0;
+       off64_t filepos = 0;
 
 #define COUNT(x)       nextblock -= x; in_buffer -= x; data += x
 #define COUNT1(x)      in_buffer -= x; data += x
@@ -1420,7 +1424,7 @@
                                d_printf("Repeat loop %d times\n", repeat);
 #endif
                                if (filepos >= 0) {     /* if < 0, one seek fails, why 
test another */
-                                       if ((filepos = lseek(fd, 0, 1)) < 0) {
+                                       if ((filepos = lseek64(fd, 0, 1)) < 0) {
                                                error("can't play loops; %s isn't 
seekable\n", name);
                                                repeat = 0;
                                        } else {
@@ -1442,7 +1446,7 @@
                                        else
                                                d_printf("Neverending loop\n");
 #endif
-                                       lseek(fd, filepos, 0);
+                                       lseek64(fd, filepos, 0);
                                        in_buffer = 0;  /* clear the buffer */
                                        goto Fill_the_buffer;
                                }
@@ -1673,7 +1677,7 @@
 /* closing .VOC */
 static void end_voc(int fd)
 {
-       off_t length_seek;
+       off64_t length_seek;
        VocBlockType bt;
        size_t cnt;
        char dummy = 0;         /* Write a Terminator */
@@ -1693,7 +1697,7 @@
        bt.datalen = (u_char) (cnt & 0xFF);
        bt.datalen_m = (u_char) ((cnt & 0xFF00) >> 8);
        bt.datalen_h = (u_char) ((cnt & 0xFF0000) >> 16);
-       if (lseek(fd, length_seek, SEEK_SET) == length_seek)
+       if (lseek64(fd, length_seek, SEEK_SET) == length_seek)
                write(fd, &bt, sizeof(VocBlockType));
        if (fd != 1)
                close(fd);
@@ -1708,7 +1712,7 @@
 static void end_wave(int fd)
 {                              /* only close output */
        WaveChunkHeader cd;
-       off_t length_seek;
+       off64_t length_seek;
        u_int rifflen;
        
        length_seek = sizeof(WaveHeader) +
@@ -1718,9 +1722,9 @@
        cd.length = fdcount > 0x7fffffff ? 0x7fffffff : LE_INT(fdcount);
        rifflen = fdcount + 2*sizeof(WaveChunkHeader) + sizeof(WaveFmtBody) + 4;
        rifflen = rifflen > 0x7fffffff ? 0x7fffffff : LE_INT(rifflen);
-       if (lseek(fd, 4, SEEK_SET) == 4)
+       if (lseek64(fd, 4, SEEK_SET) == 4)
                write(fd, &rifflen, 4);
-       if (lseek(fd, length_seek, SEEK_SET) == length_seek)
+       if (lseek64(fd, length_seek, SEEK_SET) == length_seek)
                write(fd, &cd, sizeof(WaveChunkHeader));
        if (fd != 1)
                close(fd);
@@ -1729,11 +1733,11 @@
 static void end_au(int fd)
 {                              /* only close output */
        AuHeader ah;
-       off_t length_seek;
+       off64_t length_seek;
        
        length_seek = (char *)&ah.data_size - (char *)&ah;
        ah.data_size = fdcount > 0xffffffff ? 0xffffffff : BE_INT(fdcount);
-       if (lseek(fd, length_seek, SEEK_SET) == length_seek)
+       if (lseek64(fd, length_seek, SEEK_SET) == length_seek)
                write(fd, &ah.data_size, sizeof(ah.data_size));
        if (fd != 1)
                close(fd);
@@ -1854,7 +1858,7 @@
                fd = fileno(stdin);
                name = "stdin";
        } else {
-               if ((fd = open(name, O_RDONLY, 0)) == -1) {
+               if ((fd = open64(name, O_RDONLY, 0)) == -1) {
                        perror(name);
                        exit(EXIT_FAILURE);
                }
@@ -1905,7 +1909,7 @@
                name = "stdout";
        } else {
                remove(name);
-               if ((fd = open(name, O_WRONLY | O_CREAT, 0644)) == -1) {
+               if ((fd = open64(name, O_WRONLY | O_CREAT, 0644)) == -1) {
                        perror(name);
                        exit(EXIT_FAILURE);
                }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to