sndfile-info.c : Clean up usage of SF_INFO struct.

This commit is contained in:
Erik de Castro Lopo 2006-04-30 12:51:24 +00:00
parent acd834c013
commit 038d8f62c7
2 changed files with 15 additions and 2 deletions

View File

@ -6,6 +6,9 @@
* src/sndfile.h.in
Define enums for channel mapping.
* examples/sndfile-info.c
Clean up usage of SF_INFO struct.
2006-04-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* tests/util.tpl

View File

@ -207,9 +207,15 @@ info_dump (const char *filename)
SF_INFO sfinfo ;
double signal_max, decibels ;
sfinfo.format = 0 ;
memset (&sfinfo, 0, sizeof (sfinfo)) ;
file = sf_open (filename, SFM_READ, &sfinfo) ;
if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
{ printf ("Error : Not able to open input file %s.\n", filename) ;
fflush (stdout) ;
memset (data, 0, sizeof (data)) ;
puts (sf_strerror (NULL)) ;
return ;
} ;
printf ("========================================\n") ;
sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ;
@ -268,6 +274,8 @@ instrument_dump (const char *filename)
SF_INSTRUMENT inst ;
int got_inst, k ;
memset (&sfinfo, 0, sizeof (sfinfo)) ;
if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
{ printf ("Error : Not able to open input file %s.\n", filename) ;
fflush (stdout) ;
@ -304,6 +312,8 @@ broadcast_dump (const char *filename)
SF_BROADCAST_INFO bext ;
int got_bext ;
memset (&sfinfo, 0, sizeof (sfinfo)) ;
if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
{ printf ("Error : Not able to open input file %s.\n", filename) ;
fflush (stdout) ;