X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mp3.c;h=bac84b6f9ca0e8b0677f7fec691bb42084dff760;hp=ab05d2e7d62989e61305700cbccf997d2b3641ff;hb=f6c929d9e580bb1f2666236b16de1e3fe73878d3;hpb=586cea4b850e53eedf7426379f6af6a7e76dee6e diff --git a/mp3.c b/mp3.c index ab05d2e7..bac84b6f 100644 --- a/mp3.c +++ b/mp3.c @@ -32,6 +32,7 @@ #include "server.h" #include "afs.h" #include "error.h" +#include "fd.h" /** \cond some defines and structs which are only used in this file */ @@ -106,17 +107,7 @@ static const char *mode_text[] = {"stereo", "joint stereo", "dual channel", "mon static struct mp3info mp3; static char mp3buf[8192]; static int chunk_size; -static struct audio_format *af; - -static __must_check int para_fread(void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t res = fread(ptr, size, nmemb, stream); - if (res == nmemb) - return size * nmemb; - if (feof(stream)) - return 0; - return -E_FREAD; -} +static struct audio_format_handler *af; static int header_frequency(struct mp3header *h) { @@ -490,6 +481,7 @@ static void mp3_close_audio_file(void) mp3.file = NULL; } +static const char* mp3_suffixes[] = {"mp3", NULL}; void mp3_init(void *p) { af = p; @@ -501,4 +493,5 @@ void mp3_init(void *p) /* eof_tv gets overwritten in mp3_get_file_info() */ af->eof_tv.tv_sec = 0; af->eof_tv.tv_usec = 100 * 1000; + af->suffixes = mp3_suffixes; }