1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-18 16:41:14 +02:00

Upgrades libsndfile to 1.0.24.

This commit is contained in:
lllucius
2011-04-03 03:08:57 +00:00
parent dbf2cdf605
commit fa00dd005f
267 changed files with 13363 additions and 14998 deletions

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2002-2009 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -469,7 +469,7 @@ test_open_file_or_die (const char *filename, int mode, SF_INFO *sfinfo, int allo
SNDFILE *file ;
const char *modestr, *func_name ;
int oflags = 0, omode = 0 ;
int oflags = 0, omode = 0, err ;
/*
** Need to test both sf_open() and sf_open_fd().
@@ -500,17 +500,20 @@ test_open_file_or_die (const char *filename, int mode, SF_INFO *sfinfo, int allo
} ;
if (OS_IS_WIN32)
{ /* Windows doesn't support Unix file permissions so set it to zero. */
omode = 0 ;
{ /* Windows does not understand and ignores the S_IRGRP flag, but Wine
** gives a run time warning message, so just clear it.
*/
omode &= ~S_IRGRP ;
} ;
if (allow_fd && ((++count) & 1) == 1)
{ int fd ;
fd = open (filename, oflags, omode) ;
/* Only use the three argument open() function if omode != 0. */
fd = (omode == 0) ? open (filename, oflags) : open (filename, oflags, omode) ;
if (fd < 0)
{ perror ("open") ;
{ printf ("\n\n%s : open failed : %s\n", __func__, strerror (errno)) ;
exit (1) ;
} ;
@@ -528,6 +531,13 @@ test_open_file_or_die (const char *filename, int mode, SF_INFO *sfinfo, int allo
exit (1) ;
} ;
err = sf_error (file) ;
if (err != SF_ERR_NO_ERROR)
{ printf ("\n\nLine %d : sf_error : %s\n\n", line_num, sf_error_number (err)) ;
dump_log_buffer (file) ;
exit (1) ;
} ;
return file ;
} /* test_open_file_or_die */
@@ -629,7 +639,7 @@ test_read_short_or_die (SNDFILE *file, int pass, short *test, sf_count_t items,
} ;
return ;
} /* test_read_short */
} /* test_read_short_or_die */
void
test_read_int_or_die (SNDFILE *file, int pass, int *test, sf_count_t items, int line_num)
@@ -647,7 +657,7 @@ test_read_int_or_die (SNDFILE *file, int pass, int *test, sf_count_t items, int
} ;
return ;
} /* test_read_int */
} /* test_read_int_or_die */
void
test_read_float_or_die (SNDFILE *file, int pass, float *test, sf_count_t items, int line_num)
@@ -665,7 +675,7 @@ test_read_float_or_die (SNDFILE *file, int pass, float *test, sf_count_t items,
} ;
return ;
} /* test_read_float */
} /* test_read_float_or_die */
void
test_read_double_or_die (SNDFILE *file, int pass, double *test, sf_count_t items, int line_num)
@@ -683,7 +693,7 @@ test_read_double_or_die (SNDFILE *file, int pass, double *test, sf_count_t items
} ;
return ;
} /* test_read_double */
} /* test_read_double_or_die */
void
@@ -702,7 +712,7 @@ test_readf_short_or_die (SNDFILE *file, int pass, short *test, sf_count_t frames
} ;
return ;
} /* test_readf_short */
} /* test_readf_short_or_die */
void
test_readf_int_or_die (SNDFILE *file, int pass, int *test, sf_count_t frames, int line_num)
@@ -720,7 +730,7 @@ test_readf_int_or_die (SNDFILE *file, int pass, int *test, sf_count_t frames, in
} ;
return ;
} /* test_readf_int */
} /* test_readf_int_or_die */
void
test_readf_float_or_die (SNDFILE *file, int pass, float *test, sf_count_t frames, int line_num)
@@ -738,7 +748,7 @@ test_readf_float_or_die (SNDFILE *file, int pass, float *test, sf_count_t frames
} ;
return ;
} /* test_readf_float */
} /* test_readf_float_or_die */
void
test_readf_double_or_die (SNDFILE *file, int pass, double *test, sf_count_t frames, int line_num)
@@ -756,9 +766,27 @@ test_readf_double_or_die (SNDFILE *file, int pass, double *test, sf_count_t fram
} ;
return ;
} /* test_readf_double */
} /* test_readf_double_or_die */
void
test_read_raw_or_die (SNDFILE *file, int pass, void *test, sf_count_t items, int line_num)
{ sf_count_t count ;
if ((count = sf_read_raw (file, test, items)) != items)
{ printf ("\n\nLine %d", line_num) ;
if (pass > 0)
printf (" (pass %d)", pass) ;
printf (" : sf_read_raw failed with short read (%ld => %ld).\n",
SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ;
fflush (stdout) ;
puts (sf_strerror (file)) ;
exit (1) ;
} ;
return ;
} /* test_read_raw_or_die */
void
@@ -777,7 +805,7 @@ test_write_short_or_die (SNDFILE *file, int pass, const short *test, sf_count_t
} ;
return ;
} /* test_write_short */
} /* test_write_short_or_die */
void
test_write_int_or_die (SNDFILE *file, int pass, const int *test, sf_count_t items, int line_num)
@@ -795,7 +823,7 @@ test_write_int_or_die (SNDFILE *file, int pass, const int *test, sf_count_t item
} ;
return ;
} /* test_write_int */
} /* test_write_int_or_die */
void
test_write_float_or_die (SNDFILE *file, int pass, const float *test, sf_count_t items, int line_num)
@@ -813,7 +841,7 @@ test_write_float_or_die (SNDFILE *file, int pass, const float *test, sf_count_t
} ;
return ;
} /* test_write_float */
} /* test_write_float_or_die */
void
test_write_double_or_die (SNDFILE *file, int pass, const double *test, sf_count_t items, int line_num)
@@ -831,7 +859,7 @@ test_write_double_or_die (SNDFILE *file, int pass, const double *test, sf_count_
} ;
return ;
} /* test_write_double */
} /* test_write_double_or_die */
void
@@ -850,7 +878,7 @@ test_writef_short_or_die (SNDFILE *file, int pass, const short *test, sf_count_t
} ;
return ;
} /* test_writef_short */
} /* test_writef_short_or_die */
void
test_writef_int_or_die (SNDFILE *file, int pass, const int *test, sf_count_t frames, int line_num)
@@ -868,7 +896,7 @@ test_writef_int_or_die (SNDFILE *file, int pass, const int *test, sf_count_t fra
} ;
return ;
} /* test_writef_int */
} /* test_writef_int_or_die */
void
test_writef_float_or_die (SNDFILE *file, int pass, const float *test, sf_count_t frames, int line_num)
@@ -886,7 +914,7 @@ test_writef_float_or_die (SNDFILE *file, int pass, const float *test, sf_count_t
} ;
return ;
} /* test_writef_float */
} /* test_writef_float_or_die */
void
test_writef_double_or_die (SNDFILE *file, int pass, const double *test, sf_count_t frames, int line_num)
@@ -904,7 +932,26 @@ test_writef_double_or_die (SNDFILE *file, int pass, const double *test, sf_count
} ;
return ;
} /* test_writef_double */
} /* test_writef_double_or_die */
void
test_write_raw_or_die (SNDFILE *file, int pass, const void *test, sf_count_t items, int line_num)
{ sf_count_t count ;
if ((count = sf_write_raw (file, test, items)) != items)
{ printf ("\n\nLine %d", line_num) ;
if (pass > 0)
printf (" (pass %d)", pass) ;
printf (" : sf_write_raw failed with short write (%ld => %ld).\n",
SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ;
fflush (stdout) ;
puts (sf_strerror (file)) ;
exit (1) ;
} ;
return ;
} /* test_write_raw_or_die */
void
@@ -996,7 +1043,7 @@ static int allowed_open_files = -1 ;
void
count_open_files (void)
{
#if (defined (WIN32) || defined (_WIN32))
#if OS_IS_WIN32
return ;
#else
int k, count = 0 ;
@@ -1021,7 +1068,7 @@ increment_open_file_count (void)
void
check_open_file_count_or_die (int lineno)
{
#if (defined (WIN32) || defined (_WIN32))
#if OS_IS_WIN32
lineno = 0 ;
return ;
#else