comparison libao2/ao_alsa9.c @ 8874:b8551709823d

Workaround for returning very litte buffer space.
author filon
date Fri, 10 Jan 2003 18:28:18 +0000
parents 9e045c59ffb8
children f023b30c80e5
comparison
equal deleted inserted replaced
8873:d614cfb52a42 8874:b8551709823d
56 /* 16 sets buffersize to 16 * chunksize is as default 1024 56 /* 16 sets buffersize to 16 * chunksize is as default 1024
57 * which seems to be good avarge for most situations 57 * which seems to be good avarge for most situations
58 * so buffersize is 16384 frames by default */ 58 * so buffersize is 16384 frames by default */
59 static int alsa_fragcount = 16; 59 static int alsa_fragcount = 16;
60 static int chunk_size = 1024; //is alsa_fragsize / 4 60 static int chunk_size = 1024; //is alsa_fragsize / 4
61
62 #define MIN_CHUNK_SIZE 1024
61 63
62 static size_t bits_per_sample, bytes_per_sample, bits_per_frame; 64 static size_t bits_per_sample, bytes_per_sample, bits_per_frame;
63 static size_t chunk_bytes; 65 static size_t chunk_bytes;
64 66
65 int ao_mmap = 0; 67 int ao_mmap = 0;
1082 if (ret < 0) { 1084 if (ret < 0) {
1083 printf("negative value!!\n"); 1085 printf("negative value!!\n");
1084 ret = 0; 1086 ret = 0;
1085 } 1087 }
1086 1088
1089 // workaround for too small value returned
1090 if (ret < MIN_CHUNK_SIZE)
1091 ret = 0;
1092
1087 return(ret); 1093 return(ret);
1088 } 1094 }
1089 1095
1090 /* delay in seconds between first and last sample in buffer */ 1096 /* delay in seconds between first and last sample in buffer */
1091 static float get_delay() 1097 static float get_delay()