Update of /cvsroot/alsa/alsa-utils/aplay
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11271
Modified Files:
aplay.c
Log Message:
more 64-bit stuff
Index: aplay.c
===================================================================
RCS file: /cvsroot/alsa/alsa-utils/aplay/aplay.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -r1.176 -r1.177
--- aplay.c 28 Nov 2003 10:24:53 -0000 1.176
+++ aplay.c 9 Mar 2004 13:18:29 -0000 1.177
@@ -36,6 +36,7 @@
#include <fcntl.h>
#include <ctype.h>
#include <errno.h>
+#include <limits.h>
#include <alsa/asoundlib.h>
#include <assert.h>
#include <sys/poll.h>
@@ -46,6 +47,10 @@
#include "formats.h"
#include "version.h"
+#ifndef LLONG_MAX
+#define LLONG_MAX 9223372036854775807LL
+#endif
+
#define DEFAULT_SPEED 8000
#define FORMAT_DEFAULT -1
@@ -93,7 +98,7 @@
static snd_output_t *log;
static int fd = -1;
-static off64_t pbrec_count = (size_t)-1, fdcount;
+static off64_t pbrec_count = LLONG_MAX, fdcount;
static int vocmajor, vocminor;
/* needed prototypes */
@@ -1513,15 +1518,11 @@
{
off64_t count;
- if (!timelimit && pbrec_count == (size_t)-1) {
- count = (off64_t)-1;
+ if (timelimit == 0) {
+ count = pbrec_count;
} else {
- if (timelimit == 0) {
- count = pbrec_count;
- } else {
- count = snd_pcm_format_size(hwparams.format, hwparams.rate *
hwparams.channels);
- count *= (off64_t)timelimit;
- }
+ count = snd_pcm_format_size(hwparams.format, hwparams.rate *
hwparams.channels);
+ count *= (off64_t)timelimit;
}
return count < pbrec_count ? count : pbrec_count;
}
@@ -1766,11 +1767,11 @@
/* playing raw data */
-void playback_go(int fd, size_t loaded, size_t count, int rtype, char *name)
+void playback_go(int fd, size_t loaded, off64_t count, int rtype, char *name)
{
int l, r;
- size_t written = 0;
- size_t c;
+ off64_t written = 0;
+ off64_t c;
header(rtype, name);
set_params();
@@ -1817,9 +1818,10 @@
/* capturing raw data, this proc handels WAVE files and .VOCs (as one block) */
-void capture_go(int fd, size_t count, int rtype, char *name)
+void capture_go(int fd, off64_t count, int rtype, char *name)
{
- size_t c, cur;
+ size_t c;
+ off64_t cur;
ssize_t r, err;
header(rtype, name);
@@ -1854,7 +1856,7 @@
size_t dta;
ssize_t dtawave;
- pbrec_count = (size_t)-1;
+ pbrec_count = LLONG_MAX;
fdcount = 0;
if (!name || !strcmp(name, "-")) {
fd = fileno(stdin);
@@ -1905,7 +1907,7 @@
static void capture(char *name)
{
- pbrec_count = (size_t)-1;
+ pbrec_count = LLONG_MAX;
if (!name || !strcmp(name, "-")) {
fd = fileno(stdout);
name = "stdout";
@@ -1929,7 +1931,7 @@
fmt_rec_table[file_type].end(fd);
}
-void playbackv_go(int* fds, unsigned int channels, size_t loaded, size_t count, int
rtype, char **names)
+void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t count, int
rtype, char **names)
{
int r;
size_t vsize;
@@ -1979,7 +1981,7 @@
snd_pcm_drain(handle);
}
-void capturev_go(int* fds, unsigned int channels, size_t count, int rtype, char
**names)
+void capturev_go(int* fds, unsigned int channels, off64_t count, int rtype, char
**names)
{
size_t c;
ssize_t r;
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog