mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-19 09:01:15 +02:00
Upgrades libsndfile to 1.0.24.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
** Copyright (C) 2008 George Blood Audio
|
||||
** Written by Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2008-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2008-2010 George Blood Audio
|
||||
**
|
||||
** All rights reserved.
|
||||
**
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <sndfile.h>
|
||||
@@ -61,8 +60,7 @@ main (int argc, char *argv [])
|
||||
int k ;
|
||||
|
||||
/* Store the program name. */
|
||||
progname = strrchr (argv [0], '/') ;
|
||||
progname = progname ? progname + 1 : argv [0] ;
|
||||
progname = program_name (argv [0]) ;
|
||||
|
||||
/* Check if we've been asked for help. */
|
||||
if (argc < 3 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0)
|
||||
@@ -104,6 +102,7 @@ main (int argc, char *argv [])
|
||||
HANDLE_BEXT_ARG ("--bext-orig-date", origination_date) ;
|
||||
HANDLE_BEXT_ARG ("--bext-orig-time", origination_time) ;
|
||||
HANDLE_BEXT_ARG ("--bext-coding-hist", coding_history) ;
|
||||
HANDLE_BEXT_ARG ("--bext-time-ref", time_ref) ;
|
||||
|
||||
#define HANDLE_STR_ARG(cmd,field) \
|
||||
if (strcmp (argv [k], cmd) == 0) \
|
||||
@@ -113,6 +112,7 @@ main (int argc, char *argv [])
|
||||
continue ; \
|
||||
} ;
|
||||
|
||||
HANDLE_STR_ARG ("--str-comment", comment) ;
|
||||
HANDLE_STR_ARG ("--str-title", title) ;
|
||||
HANDLE_STR_ARG ("--str-copyright", copyright) ;
|
||||
HANDLE_STR_ARG ("--str-artist", artist) ;
|
||||
@@ -207,8 +207,10 @@ usage_exit (const char *progname, int exit_code)
|
||||
" --bext-umid Set the 'bext' UMID.\n"
|
||||
" --bext-orig-date Set the 'bext' origination date.\n"
|
||||
" --bext-orig-time Set the 'bext' origination time.\n"
|
||||
" --bext-coding-hist Set the 'bext' coding history\n"
|
||||
" --bext-coding-hist Set the 'bext' coding history.\n"
|
||||
" --bext-time-raf Set the 'bext' Time ref.\n"
|
||||
"\n"
|
||||
" --str-comment Set the metadata comment.\n"
|
||||
" --str-title Set the metadata title.\n"
|
||||
" --str-copyright Set the metadata copyright.\n"
|
||||
" --str-artist Set the metadata artist.\n"
|
||||
@@ -232,6 +234,7 @@ usage_exit (const char *progname, int exit_code)
|
||||
"exit with an appropriate error message.\n"
|
||||
) ;
|
||||
|
||||
printf ("Using %s.\n\n", sf_version_string ()) ;
|
||||
exit (exit_code) ;
|
||||
} /* usage_exit */
|
||||
|
||||
@@ -251,7 +254,7 @@ has_bext_fields_set (const METADATA_INFO * info)
|
||||
if (info->description || info->originator || info->originator_reference)
|
||||
return 1 ;
|
||||
|
||||
if (info->origination_date || info->origination_time || info->umid || info->coding_history)
|
||||
if (info->origination_date || info->origination_time || info->umid || info->coding_history || info->time_ref)
|
||||
return 1 ;
|
||||
|
||||
return 0 ;
|
||||
@@ -260,18 +263,20 @@ has_bext_fields_set (const METADATA_INFO * info)
|
||||
static void
|
||||
read_localtime (struct tm * timedata)
|
||||
{ time_t current ;
|
||||
struct tm *tmptr ;
|
||||
|
||||
time (¤t) ;
|
||||
memset (timedata, 0, sizeof (struct tm)) ;
|
||||
|
||||
#if defined (HAVE_LOCALTIME_R)
|
||||
/* If the re-entrant version is available, use it. */
|
||||
tmptr = localtime_r (¤t, timedata) ;
|
||||
localtime_r (¤t, timedata) ;
|
||||
#elif defined (HAVE_LOCALTIME)
|
||||
/* Otherwise use the standard one and copy the data to local storage. */
|
||||
tmptr = localtime (¤t) ;
|
||||
memcpy (timedata, tmptr, sizeof (struct tm)) ;
|
||||
{
|
||||
struct tm *tmptr ;
|
||||
/* Otherwise use the standard one and copy the data to local storage. */
|
||||
if ((tmptr = localtime (¤t)) != NULL)
|
||||
memcpy (timedata, tmptr, sizeof (struct tm)) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ;
|
||||
|
Reference in New Issue
Block a user