[PD-cvs] pd/src d_soundfile.c, 1.4.4.11.2.10.2.23, 1.4.4.11.2.10.2.24

Mathieu Bouchard matju at users.sourceforge.net
Fri Jul 20 06:21:38 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18518

Modified Files:
      Tag: desiredata
	d_soundfile.c 
Log Message:
removed some MAXPDSTRING


Index: d_soundfile.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v
retrieving revision 1.4.4.11.2.10.2.23
retrieving revision 1.4.4.11.2.10.2.24
diff -C2 -d -r1.4.4.11.2.10.2.23 -r1.4.4.11.2.10.2.24
*** d_soundfile.c	19 Jul 2007 20:17:26 -0000	1.4.4.11.2.10.2.23
--- d_soundfile.c	20 Jul 2007 04:21:36 -0000	1.4.4.11.2.10.2.24
***************
*** 153,157 ****
  #define WRITEHDRSIZE (AIFFPLUS > WHDR2 ? AIFFPLUS : WHDR2)
  #define READHDRSIZE (16 > WHDR2 + 2 ? 16 : WHDR2 + 2)
- #define OBUFSIZE MAXPDSTRING  /* assume MAXPDSTRING is bigger than headers */
  
  #ifdef MSW
--- 153,156 ----
***************
*** 206,210 ****
          bytelimit    = p->bytelimit;
      } else {
!         char buf[OBUFSIZE];
          int bytesread = read(fd, buf, READHDRSIZE);
          int format;
--- 205,209 ----
          bytelimit    = p->bytelimit;
      } else {
!         char buf[MAXPDSTRING];
          int bytesread = read(fd, buf, READHDRSIZE);
          int format;
***************
*** 319,325 ****
     a not-perfectly-threadsafe way.  LATER replace with a thread-hardened version of open_soundfile_via_canvas() */
  static int open_soundfile(const char *dirname, const char *filename, int headersize, t_param *p, long skipframes) {
!     char buf[OBUFSIZE], *bufptr;
!     int fd = open_via_path(dirname, filename, "", buf, &bufptr, MAXPDSTRING, 1);
      if (fd < 0) return -1;
      return open_soundfile_via_fd(fd, headersize, p, skipframes);
  }
--- 318,325 ----
     a not-perfectly-threadsafe way.  LATER replace with a thread-hardened version of open_soundfile_via_canvas() */
  static int open_soundfile(const char *dirname, const char *filename, int headersize, t_param *p, long skipframes) {
!     char *buf, *bufptr;
!     int fd = open_via_path2(dirname, filename, "", &buf, &bufptr, 1);
      if (fd < 0) return -1;
+     free(buf);
      return open_soundfile_via_fd(fd, headersize, p, skipframes);
  }
***************
*** 472,477 ****
          static unsigned char dogdoo[] = {0x40, 0x0e, 0xac, 0x44, 0, 0, 0, 0, 0, 0, 'S', 'S', 'N', 'D'};
          t_aiff *aiffhdr = (t_aiff *)headerbuf;
!         if (!strcaseends(filenamebuf,".aif") && !strcaseends(filenamebuf,".aiff"))
!                 strcat(filenamebuf, ".aif");
          strncpy(aiffhdr->fileid, "FORM", 4);
          aiffhdr->chunksize = swap4(datasize + sizeof(*aiffhdr) + 4, swap);
--- 472,476 ----
          static unsigned char dogdoo[] = {0x40, 0x0e, 0xac, 0x44, 0, 0, 0, 0, 0, 0, 'S', 'S', 'N', 'D'};
          t_aiff *aiffhdr = (t_aiff *)headerbuf;
!         if (!strcaseends(filenamebuf,".aif") && !strcaseends(filenamebuf,".aiff")) strcat(filenamebuf, ".aif");
          strncpy(aiffhdr->fileid, "FORM", 4);
          aiffhdr->chunksize = swap4(datasize + sizeof(*aiffhdr) + 4, swap);





More information about the Pd-cvs mailing list