summaryrefslogtreecommitdiff
path: root/src/libmad/xine_decoder.c
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2002-10-17 17:43:41 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2002-10-17 17:43:41 +0000
commit3bb1499e2dd8f9e63494259343968ae71060f6cb (patch)
tree208a51acd986b4f60aa90e6a61771e9633bbf44f /src/libmad/xine_decoder.c
parent76450053c7fa0b7dac22b5a0d77c287ac1410fca (diff)
downloadxine-lib-3bb1499e2dd8f9e63494259343968ae71060f6cb.tar.gz
xine-lib-3bb1499e2dd8f9e63494259343968ae71060f6cb.tar.bz2
move open_plugin function (used to create new plugin instances) from the plugin info
struct to the plugin class struct small nerby change in libffmpeg decoder plugin: access to video_out/audio_out in decoders should now be done via the appropriate members in xine_stream_t CVS patchset: 2843 CVS date: 2002/10/17 17:43:41
Diffstat (limited to 'src/libmad/xine_decoder.c')
-rw-r--r--src/libmad/xine_decoder.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/libmad/xine_decoder.c b/src/libmad/xine_decoder.c
index 63e28f4c2..526eb75f3 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.28 2002/10/16 23:13:19 guenter Exp $
+ * $Id: xine_decoder.c,v 1.29 2002/10/17 17:43:43 mroi Exp $
*
* stuff needed to turn libmad into a xine decoder plugin
*/
@@ -250,11 +250,9 @@ static void mad_dispose (audio_decoder_t *this_gen) {
free (this_gen);
}
-void * open_plugin (void *class_gen, xine_stream_t *stream,
- const void *ao_gen) {
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
mad_decoder_t *this ;
- ao_instance_t *ao = (ao_instance_t *) ao_gen;
this = (mad_decoder_t *) malloc (sizeof (mad_decoder_t));
@@ -262,7 +260,6 @@ void * open_plugin (void *class_gen, xine_stream_t *stream,
this->audio_decoder.reset = mad_reset;
this->audio_decoder.dispose = mad_dispose;
- this->audio_out = ao;
this->output_open = 0;
this->bytes_in_buffer = 0;
@@ -274,22 +271,22 @@ void * open_plugin (void *class_gen, xine_stream_t *stream,
printf ("libmad: init\n");
#endif
- return this;
+ return &this->audio_decoder;
}
/*
* mad plugin class
*/
-static char *get_identifier (video_decoder_class_t *this) {
+static char *get_identifier (audio_decoder_class_t *this) {
return "mad";
}
-static char *get_description (video_decoder_class_t *this) {
+static char *get_description (audio_decoder_class_t *this) {
return "libmad based mpeg audio layer 1/2/3 decoder plugin";
}
-static void dispose_class (video_decoder_class_t *this) {
+static void dispose_class (audio_decoder_class_t *this) {
free (this);
}
@@ -299,6 +296,7 @@ static void *init_plugin (xine_t *xine, void *data) {
this = (mad_class_t *) malloc (sizeof (mad_class_t));
+ this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
this->decoder_class.get_description = get_description;
this->decoder_class.dispose = dispose_class;
@@ -317,7 +315,6 @@ static decoder_info_t dec_info_audio = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 10, "mad", XINE_VERSION_CODE, &dec_info_audio,
- init_plugin, open_plugin },
+ { PLUGIN_AUDIO_DECODER, 10, "mad", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};