From: Andre Noll Date: Sun, 11 Mar 2007 17:23:24 +0000 (+0100) Subject: kill global variable af from all audio format handlers X-Git-Tag: v0.2.16~34 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=3a624c04894f5b0fa4a1c0850307b33bf92c8e51;p=paraslash.git kill global variable af from all audio format handlers Also rename the argument of the init function from "p" to "afh". --- diff --git a/aac_afh.c b/aac_afh.c index ab97cdad..1ab86597 100644 --- a/aac_afh.c +++ b/aac_afh.c @@ -191,9 +191,9 @@ out: static const char* aac_suffixes[] = {"m4a", "mp4", NULL}; /** the init function of the aac audio format handler */ -void aac_afh_init(struct audio_format_handler *p) +void aac_afh_init(struct audio_format_handler *afh) { - p->get_file_info = aac_get_file_info, - p->close_audio_file = aac_close_audio_file; - p->suffixes = aac_suffixes; + afh->get_file_info = aac_get_file_info, + afh->close_audio_file = aac_close_audio_file; + afh->suffixes = aac_suffixes; } diff --git a/mp3_afh.c b/mp3_afh.c index 898547fc..51b95c99 100644 --- a/mp3_afh.c +++ b/mp3_afh.c @@ -104,7 +104,6 @@ static const char *mode_text[] = {"stereo", "joint stereo", "dual channel", "mon static FILE *infile; static struct mp3info mp3; -static struct audio_format_handler *af; static ssize_t num_chunks; static int header_frequency(struct mp3header *h) @@ -476,10 +475,9 @@ static const char* mp3_suffixes[] = {"mp3", NULL}; * * \param p pointer to the struct to initialize */ -void mp3_init(struct audio_format_handler *p) +void mp3_init(struct audio_format_handler *afh) { - af = p; - af->get_file_info = mp3_get_file_info; - af->close_audio_file = mp3_close_audio_file; - af->suffixes = mp3_suffixes; + afh->get_file_info = mp3_get_file_info; + afh->close_audio_file = mp3_close_audio_file; + afh->suffixes = mp3_suffixes; } diff --git a/ogg_afh.c b/ogg_afh.c index f972c630..10340913 100644 --- a/ogg_afh.c +++ b/ogg_afh.c @@ -33,7 +33,6 @@ static double chunk_time = 0.25; FILE *audio_file; -static struct audio_format_handler *af; static size_t cb_read(void *buf, size_t size, size_t nmemb, void *datasource) { @@ -286,10 +285,9 @@ static const char* ogg_suffixes[] = {"ogg", NULL}; * * \param p pointer to the struct to initialize */ -void ogg_init(struct audio_format_handler *p) +void ogg_init(struct audio_format_handler *afh) { - af = p; - af->get_file_info = ogg_get_file_info, - af->close_audio_file = ogg_close_audio_file; - af->suffixes = ogg_suffixes; + afh->get_file_info = ogg_get_file_info, + afh->close_audio_file = ogg_close_audio_file; + afh->suffixes = ogg_suffixes; }