diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-09-04 23:31:05 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-09-04 23:31:05 +0000 |
commit | 403f01979cef7e03b8322ddb870e3959c8de0f77 (patch) | |
tree | 0c40e03354069d59379b924ac9deeee0d17b10d8 /src/libmad | |
parent | d1010f51a2cb07ba83d71423ab740a5a0c3d0934 (diff) | |
download | xine-lib-403f01979cef7e03b8322ddb870e3959c8de0f77.tar.gz xine-lib-403f01979cef7e03b8322ddb870e3959c8de0f77.tar.bz2 |
merging in the new_api branch ... unfortunately video_out / vo_scale is broken now ... matthias/miguel: please fix it :-)
CVS patchset: 2606
CVS date: 2002/09/04 23:31:05
Diffstat (limited to 'src/libmad')
-rw-r--r-- | src/libmad/xine_decoder.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/libmad/xine_decoder.c b/src/libmad/xine_decoder.c index 71aa183d9..f3723890e 100644 --- a/src/libmad/xine_decoder.c +++ b/src/libmad/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.23 2002/07/28 21:10:40 heikos Exp $ + * $Id: xine_decoder.c,v 1.24 2002/09/04 23:31:09 guenter Exp $ * * stuff needed to turn libmad into a xine decoder plugin */ @@ -25,9 +25,9 @@ #include <stdlib.h> #include <string.h> +#include "xine_internal.h" #include "audio_out.h" #include "buffer.h" -#include "xine_internal.h" #include "frame.h" #include "synth.h" #include "xineutils.h" @@ -57,11 +57,6 @@ typedef struct mad_decoder_s { } mad_decoder_t; -static int mad_can_handle (audio_decoder_t *this_gen, int buf_type) { - return ((buf_type & 0xFFFF0000) == BUF_AUDIO_MPEG) ; -} - - static void mad_reset (audio_decoder_t *this_gen) { mad_decoder_t *this = (mad_decoder_t *) this_gen; @@ -275,23 +270,12 @@ static void mad_dispose (audio_decoder_t *this_gen) { free (this_gen); } -audio_decoder_t *init_audio_decoder_plugin (int iface_version, xine_t *xine) { +void *init_audio_decoder_plugin (xine_t *xine, void *data) { mad_decoder_t *this ; - if (iface_version != 9) { - printf(_("libmad: plugin doesn't support plugin API version %d.\n" - "libmad: this means there's a version mismatch between xine and this " - "libmad: decoder plugin.\nInstalling current plugins should help.\n"), - iface_version); - - return NULL; - } - this = (mad_decoder_t *) malloc (sizeof (mad_decoder_t)); - this->audio_decoder.interface_version = iface_version; - this->audio_decoder.can_handle = mad_can_handle; this->audio_decoder.init = mad_init; this->audio_decoder.decode_data = mad_decode_data; this->audio_decoder.reset = mad_reset; @@ -300,6 +284,20 @@ audio_decoder_t *init_audio_decoder_plugin (int iface_version, xine_t *xine) { this->audio_decoder.dispose = mad_dispose; this->audio_decoder.priority = 5; - return (audio_decoder_t *) this; + return this; } +static uint32_t audio_types[] = { + BUF_AUDIO_MPEG, 0 +}; + +static decoder_info_t dec_info_audio = { + audio_types, /* supported types */ + 5 /* priority */ +}; + +plugin_info_t xine_plugin_info[] = { + /* type, API, "name", version, special_info, init_function */ + { PLUGIN_AUDIO_DECODER, 9, "mad", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_plugin }, + { PLUGIN_NONE, 0, "", 0, NULL, NULL } +}; |