[BACK]Return to headers.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / aucat

Diff for /src/usr.bin/aucat/Attic/headers.c between version 1.4 and 1.5

version 1.4, 2009/01/23 17:38:15 version 1.5, 2009/04/11 10:24:21
Line 52 
Line 52 
 char wav_id_fmt[4] = { 'f', 'm', 't', ' ' };  char wav_id_fmt[4] = { 'f', 'm', 't', ' ' };
   
 int  int
 wav_readfmt(int fd, unsigned csize, struct aparams *par)  wav_readfmt(int fd, unsigned csize, struct aparams *par, int *renc)
 {  {
         struct wavfmt fmt;          struct wavfmt fmt;
         unsigned nch, cmax, rate, bits, enc;          unsigned nch, cmax, rate, bits, enc;
Line 66 
Line 66 
                 return 0;                  return 0;
         }          }
         enc = letoh16(fmt.fmt);          enc = letoh16(fmt.fmt);
         if (enc != 1) {          if (renc == NULL && enc != 1) {
                 warnx("%u: only \"pcm\" encoding supported", enc);                  warnx("%u: only \"pcm\" encoding supported", enc);
                 return 0;                  return 0;
         }          }
Line 97 
Line 97 
         par->msb = 1;          par->msb = 1;
         par->cmax = cmax;          par->cmax = cmax;
         par->rate = rate;          par->rate = rate;
           if (renc)
                   *renc = enc;
 #ifdef DEBUG  #ifdef DEBUG
         if (debug_level > 0) {          if (debug_level > 0) {
                 fprintf(stderr, "wav_readfmt: using ");                  fprintf(stderr, "wav_readfmt: using ");
Line 108 
Line 110 
 }  }
   
 int  int
 wav_readhdr(int fd, struct aparams *par, off_t *datasz)  wav_readhdr(int fd, struct aparams *par, off_t *datasz, int *renc)
 {  {
         struct wavriff riff;          struct wavriff riff;
         struct wavchunk chunk;          struct wavchunk chunk;
Line 136 
Line 138 
                 }                  }
                 csize = letoh32(chunk.size);                  csize = letoh32(chunk.size);
                 if (memcmp(chunk.id, wav_id_fmt, 4) == 0) {                  if (memcmp(chunk.id, wav_id_fmt, 4) == 0) {
                         if (!wav_readfmt(fd, csize, par))                          if (!wav_readfmt(fd, csize, par, renc))
                                 return 0;                                  return 0;
                         fmt_done = 1;                          fmt_done = 1;
                 } else if (memcmp(chunk.id, wav_id_data, 4) == 0) {                  } else if (memcmp(chunk.id, wav_id_data, 4) == 0) {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5