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

Diff for /src/usr.bin/aucat/Attic/wav.c between version 1.25 and 1.26

version 1.25, 2011/05/09 17:32:27 version 1.26, 2011/06/03 10:05:27
Line 14 
Line 14 
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */   */
   
   #include <fcntl.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <stdio.h>  #include <stdio.h>
 #include <fcntl.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   
 #include "abuf.h"  #include "abuf.h"
Line 661 
Line 662 
 }  }
   
 /*  /*
    * determine the header by the file name
    */
   unsigned
   wav_autohdr(char *name, unsigned hdr)
   {
           size_t len;
   
           if (hdr != HDR_AUTO)
                   return hdr;
           if (name == NULL)
                   return HDR_RAW;
           len = strlen(name);
           if (len >= 4 && strcasecmp(name + len - 4, ".wav") == 0)
                   return HDR_WAV;
           else
                   return HDR_RAW;
   }
   
   /*
  * create a file reader in the ``INIT'' state   * create a file reader in the ``INIT'' state
  */   */
 struct wav *  struct wav *
Line 671 
Line 691 
         int fd;          int fd;
         struct wav *f;          struct wav *f;
   
           hdr = wav_autohdr(name, hdr);
         if (name != NULL) {          if (name != NULL) {
                 fd = open(name, O_RDONLY | O_NONBLOCK, 0666);                  fd = open(name, O_RDONLY | O_NONBLOCK, 0666);
                 if (fd < 0) {                  if (fd < 0) {
Line 726 
Line 747 
         f->join = join;          f->join = join;
         f->mode = mode;          f->mode = mode;
         f->hpar = *par;          f->hpar = *par;
         f->hdr = 0;          f->hdr = hdr;
         f->xrun = xrun;          f->xrun = xrun;
         f->maxweight = MIDI_TO_ADATA(volctl);          f->maxweight = MIDI_TO_ADATA(volctl);
         f->slot = ctl_slotnew(f->dev->midi, "play", &ctl_wavops, f, 1);          f->slot = ctl_slotnew(f->dev->midi, "play", &ctl_wavops, f, 1);
Line 760 
Line 781 
         int fd;          int fd;
         struct wav *f;          struct wav *f;
   
           hdr = wav_autohdr(name, hdr);
         if (name == NULL) {          if (name == NULL) {
                 name = "stdout";                  name = "stdout";
                 fd = STDOUT_FILENO;                  fd = STDOUT_FILENO;

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26