#include "server.h"
#include "afs.h"
#include "error.h"
+#include "fd.h"
/** \cond some defines and structs which are only used in this file */
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)
{
mp3.file = NULL;
}
-void mp3_init(void *p)
+static const char* mp3_suffixes[] = {"mp3", NULL};
+void mp3_init(struct audio_format_handler *p)
{
af = p;
af->get_file_info = mp3_get_file_info;
/* 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;
}