diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2004-01-21 07:46:34 +0000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2004-01-21 07:46:34 +0000 |
commit | a1e9265cad03d076a84b74ddf566dff4f2ad8e3b (patch) | |
tree | 5e4935ce9bd1f4b88751187b88bcd358729388f9 /src/svx.c | |
parent | cb979e10a703033864f8f42c94e9d1d335e5be40 (diff) |
initial import
(automatically generated log message)
Diffstat (limited to 'src/svx.c')
-rw-r--r-- | src/svx.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -1,5 +1,5 @@ /* -** Copyright (C) 1999-2004 Erik de Castro Lopo <erikd@mega-nerd.com> +** Copyright (C) 1999-2003 Erik de Castro Lopo <erikd@zip.com.au> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU Lesser General Public License as published by @@ -16,7 +16,7 @@ ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "sfconfig.h" +#include "config.h" #include <stdio.h> #include <string.h> @@ -80,7 +80,7 @@ static int svx_read_header (SF_PRIVATE *psf) ; int svx_open (SF_PRIVATE *psf) -{ int error ; +{ int error, subformat ; if (psf->mode == SFM_READ || (psf->mode == SFM_RDWR && psf->filelength > 0)) { if ((error = svx_read_header (psf))) @@ -95,6 +95,8 @@ svx_open (SF_PRIVATE *psf) psf_fseek (psf, psf->dataoffset, SEEK_SET) ; } ; + subformat = psf->sf.format & SF_FORMAT_SUBMASK ; + if (psf->mode == SFM_WRITE || psf->mode == SFM_RDWR) { if (psf->is_pipe) return SFE_NO_PIPE_WRITE ; @@ -116,7 +118,7 @@ svx_open (SF_PRIVATE *psf) psf->write_header = svx_write_header ; } ; - psf->container_close = svx_close ; + psf->close = svx_close ; if ((error = pcm_init (psf))) return error ; @@ -134,13 +136,9 @@ svx_read_header (SF_PRIVATE *psf) int filetype = 0, parsestage = 0, done = 0 ; int bytecount = 0, channels ; - if (psf->filelength > SF_PLATFORM_S64 (0xffffffff)) - psf_log_printf (psf, "Warning : filelength > 0xffffffff. This is bad!!!!\n") ; - - memset (&vhdr, 0, sizeof (vhdr)) ; psf_binheader_readf (psf, "p", 0) ; - /* Set default number of channels. Currently can't handle stereo SVX files. */ + /* Set default number of channels. */ psf->sf.channels = 1 ; psf->sf.format = SF_FORMAT_SVX ; @@ -281,9 +279,8 @@ svx_read_header (SF_PRIVATE *psf) psf_log_printf (psf, " %M : %d\n", marker, dword) ; bytecount += psf_binheader_readf (psf, "E4", &channels) ; - psf->sf.channels = channels ; - psf_log_printf (psf, " Channels : %d\n", channels) ; + psf_log_printf (psf, " Channels : %d => %d\n", channels) ; psf_binheader_readf (psf, "j", dword - bytecount) ; break ; |