examples/sndfile-convert.c : In function copy_metadata(), copy broadcast info if present.

This commit is contained in:
Erik de Castro Lopo 2008-08-16 16:11:30 +10:00
parent 0c1236235a
commit 7ec8cfadf2
2 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,9 @@
* configure.ac
Test for localtime and localtime_r.
* examples/sndfile-convert.c
In function copy_metadata(), copy broadcast info if present.
* examples/sndfile-bwf-set.c examples/Makefile.am
Add new file examples/sndfile-bwf-set.c and hook into build.

View File

@ -346,6 +346,7 @@ main (int argc, char * argv [])
static void
copy_metadata (SNDFILE *outfile, SNDFILE *infile)
{ SF_INSTRUMENT inst ;
SF_BROADCAST_INFO binfo ;
const char *str ;
int k, err = 0 ;
@ -356,9 +357,14 @@ copy_metadata (SNDFILE *outfile, SNDFILE *infile)
} ;
memset (&inst, 0, sizeof (inst)) ;
memset (&binfo, 0, sizeof (binfo)) ;
if (sf_command (infile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) == SF_TRUE)
sf_command (outfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) ;
if (sf_command (infile, SFC_GET_BROADCAST_INFO, &binfo, sizeof (binfo)) == SF_TRUE)
sf_command (outfile, SFC_SET_BROADCAST_INFO, &binfo, sizeof (binfo)) ;
} /* copy_metadata */
static void