summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_mod.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_mod.c')
-rw-r--r--src/demuxers/demux_mod.c77
1 files changed, 23 insertions, 54 deletions
diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c
index 2749eb048..4de5ca7d8 100644
--- a/src/demuxers/demux_mod.c
+++ b/src/demuxers/demux_mod.c
@@ -31,8 +31,6 @@
#include "config.h"
#endif
-#ifdef HAVE_MODPLUG
-
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
@@ -44,11 +42,10 @@
/* #define LOG_VERBOSE */
/* #define LOG */
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
-#include "group_audio.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "modplug.h"
#include "bswap.h"
@@ -347,21 +344,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
case METHOD_EXPLICIT:
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- if (!open_mod_file(this)) {
- free (this);
- return NULL;
- }
- }
+ case METHOD_BY_MRL:
break;
case METHOD_BY_CONTENT:
@@ -376,20 +359,16 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "ModPlug Amiga MOD Music file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "mod";
-}
+static void *demux_mod_init_plugin (xine_t *xine, void *data) {
+ demux_mod_class_t *this;
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mod it stm s3m 669 amf med mdl xm";
-}
+ this = calloc(1, sizeof(demux_mod_class_t));
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-mod: mod: SoundTracker/NoiseTracker/ProTracker Module;"
+ this->demux_class.open_plugin = open_plugin;
+ this->demux_class.description = N_("ModPlug Amiga MOD Music file demux plugin");
+ this->demux_class.identifier = "mod";
+ this->demux_class.mimetypes =
+ "audio/x-mod: mod: SoundTracker/NoiseTracker/ProTracker Module;"
"audio/mod: mod: SoundTracker/NoiseTracker/ProTracker Module;"
"audio/it: it: ImpulseTracker Module;"
"audio/x-it: it: ImpulseTracker Module;"
@@ -402,27 +381,17 @@ static const char *get_mimetypes (demux_class_t *this_gen) {
"audio/x-amf: amf: ADRIFT Module File;"
"audio/x-xm: xm: FastTracker II Audio;"
"audio/xm: xm: FastTracker II Audio;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_mod_class_t *this = (demux_mod_class_t *) this_gen;
-
- free (this);
-}
-
-void *demux_mod_init_plugin (xine_t *xine, void *data) {
- demux_mod_class_t *this;
-
- this = calloc(1, sizeof(demux_mod_class_t));
-
- this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.extensions = "mod it stm s3m 669 amf med mdl xm";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
-#endif /* HAVE_MODPLUG */
+static const demuxer_info_t demux_info_mod = {
+ 10 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ { PLUGIN_DEMUX, 27, "modplug", XINE_VERSION_CODE, &demux_info_mod, demux_mod_init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};