From 78fc25b90a9659048ba3a9a178a45a3e536765f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 13:26:26 +0100 Subject: Update all misc plugins to the new identifier/description interface. Add _() where missing, for i18n. --- src/libsputext/demux_sputext.c | 4 ++-- src/libsputext/xine_sputext_decoder.c | 12 ++---------- 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'src/libsputext') diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 502ef6580..161bb10d3 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -1488,8 +1488,8 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) { this = xine_xmalloc (sizeof (demux_sputext_class_t)); this->demux_class.open_plugin = open_demux_plugin; - this->demux_class.get_description = get_demux_description; - this->demux_class.get_identifier = get_demux_identifier; + this->demux_class.description = FLAMEFIXMEget_demux_description; + this->demux_class.identifier = FLAMEFIXMEget_demux_identifier; this->demux_class.get_mimetypes = get_demux_mimetypes; this->demux_class.get_extensions = get_demux_extensions; this->demux_class.dispose = demux_class_dispose; diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c index dabb2dddc..d21e8dd6f 100644 --- a/src/libsputext/xine_sputext_decoder.c +++ b/src/libsputext/xine_sputext_decoder.c @@ -887,14 +887,6 @@ static void sputext_class_dispose (spu_decoder_class_t *class_gen) { free (this); } -static char *sputext_class_get_identifier (spu_decoder_class_t *this) { - return "sputext"; -} - -static char *sputext_class_get_description (spu_decoder_class_t *this) { - return "external subtitle decoder plugin"; -} - static void update_src_encoding(void *class_gen, xine_cfg_entry_t *entry) { sputext_class_t *class = (sputext_class_t *)class_gen; @@ -915,8 +907,8 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) { this = (sputext_class_t *) xine_xmalloc (sizeof (sputext_class_t)); this->class.open_plugin = sputext_class_open_plugin; - this->class.get_identifier = sputext_class_get_identifier; - this->class.get_description = sputext_class_get_description; + this->class.identifier = "sputext"; + this->class.description = _("external subtitle decoder plugin"); this->class.dispose = sputext_class_dispose; this->xine = xine; -- cgit v1.2.3 From 6834a34aeb2da67dc0d1bb4c73133625cd34fc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 13:33:26 +0100 Subject: Update libsputext demuxer, which I forgot on the previous run. --- src/libsputext/demux_sputext.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/libsputext') diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 161bb10d3..a1b1d93a2 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -1448,14 +1448,6 @@ static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_ return NULL; } -static const char *get_demux_description (demux_class_t *this_gen) { - return "sputext demuxer plugin"; -} - -static const char *get_demux_identifier (demux_class_t *this_gen) { - return "sputext"; -} - static const char *get_demux_extensions (demux_class_t *this_gen) { return "asc txt sub srt smi ssa"; } @@ -1488,8 +1480,8 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) { this = xine_xmalloc (sizeof (demux_sputext_class_t)); this->demux_class.open_plugin = open_demux_plugin; - this->demux_class.description = FLAMEFIXMEget_demux_description; - this->demux_class.identifier = FLAMEFIXMEget_demux_identifier; + this->demux_class.description = _("sputext demuxer plugin"); + this->demux_class.identifier = "sputext"; this->demux_class.get_mimetypes = get_demux_mimetypes; this->demux_class.get_extensions = get_demux_extensions; this->demux_class.dispose = demux_class_dispose; -- cgit v1.2.3 From e2a10c5fdaed1f45040fb3d737ab79f0e5d774d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 14:12:35 +0100 Subject: Use N_() rather than _(), passing the string just once to gettext(). This way the gettext code for description does not need to be repeated by every plugin. --- src/libsputext/demux_sputext.c | 2 +- src/libsputext/xine_sputext_decoder.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsputext') diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index a1b1d93a2..68f436729 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -1480,7 +1480,7 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) { this = xine_xmalloc (sizeof (demux_sputext_class_t)); this->demux_class.open_plugin = open_demux_plugin; - this->demux_class.description = _("sputext demuxer plugin"); + this->demux_class.description = N_("sputext demuxer plugin"); this->demux_class.identifier = "sputext"; this->demux_class.get_mimetypes = get_demux_mimetypes; this->demux_class.get_extensions = get_demux_extensions; diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c index d21e8dd6f..88977496e 100644 --- a/src/libsputext/xine_sputext_decoder.c +++ b/src/libsputext/xine_sputext_decoder.c @@ -908,7 +908,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) { this->class.open_plugin = sputext_class_open_plugin; this->class.identifier = "sputext"; - this->class.description = _("external subtitle decoder plugin"); + this->class.description = N_("external subtitle decoder plugin"); this->class.dispose = sputext_class_dispose; this->xine = xine; -- cgit v1.2.3 From 32a70cef7fdce1648d6850dafbe78bee04830429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 15:40:37 +0100 Subject: Use default_*_class_dispose macro whenever the class dispose function only called free(). --- src/libsputext/demux_sputext.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/libsputext') diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 68f436729..6e8b1a646 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -1459,12 +1459,6 @@ static const char *get_demux_mimetypes (demux_class_t *this_gen) { /* "text/plain: asc txt sub srt: VIDEO subtitles;" */ } -static void demux_class_dispose (demux_class_t *this_gen) { - demux_sputext_class_t *this = (demux_sputext_class_t *) this_gen; - - free (this); -} - static void config_timeout_cb(void *this_gen, xine_cfg_entry_t *entry) { demux_sputext_class_t *this = (demux_sputext_class_t *)this_gen; @@ -1484,7 +1478,7 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) { this->demux_class.identifier = "sputext"; this->demux_class.get_mimetypes = get_demux_mimetypes; this->demux_class.get_extensions = get_demux_extensions; - this->demux_class.dispose = demux_class_dispose; + this->demux_class.dispose = default_demux_class_dispose; /* * Some subtitling formats, namely AQT and Subrip09, define the end of a -- cgit v1.2.3 From b9dffdcf551ccd23b31618cf86716082e9f50f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 18:08:49 +0100 Subject: Bump the interface version for SPU decoders. --- src/libsputext/xine_sputext_decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsputext') diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c index 88977496e..f67fd7a7e 100644 --- a/src/libsputext/xine_sputext_decoder.c +++ b/src/libsputext/xine_sputext_decoder.c @@ -986,6 +986,6 @@ static const decoder_info_t spudec_info = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_SPU_DECODER | PLUGIN_MUST_PRELOAD, 16, "sputext", XINE_VERSION_CODE, &spudec_info, &init_spu_decoder_plugin }, + { PLUGIN_SPU_DECODER | PLUGIN_MUST_PRELOAD, 17, "sputext", XINE_VERSION_CODE, &spudec_info, &init_spu_decoder_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; -- cgit v1.2.3 From 265e36a8ddde1fa296ea39c67928aa1b7a11f7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 18:16:49 +0100 Subject: Bump the interface version for demuxer plugins. --- src/libsputext/demux_sputext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsputext') diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 6e8b1a646..5f8ea103d 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -1498,6 +1498,6 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 26, "sputext", XINE_VERSION_CODE, NULL, &init_sputext_demux_class }, + { PLUGIN_DEMUX, 27, "sputext", XINE_VERSION_CODE, NULL, &init_sputext_demux_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; -- cgit v1.2.3 From bebea7e1e218eed9e72dac3c7c2934f16c96f4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 19:04:47 +0100 Subject: Transform get_extensions and get_mimetypes into strings. Please note that this commit temporarily breaks building. --- src/libsputext/demux_sputext.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/libsputext') diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 5f8ea103d..0c9124786 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -1448,17 +1448,6 @@ static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_ return NULL; } -static const char *get_demux_extensions (demux_class_t *this_gen) { - return "asc txt sub srt smi ssa"; -} - -static const char *get_demux_mimetypes (demux_class_t *this_gen) { - return NULL; - - /* do not report this mimetype, it might confuse browsers. */ - /* "text/plain: asc txt sub srt: VIDEO subtitles;" */ -} - static void config_timeout_cb(void *this_gen, xine_cfg_entry_t *entry) { demux_sputext_class_t *this = (demux_sputext_class_t *)this_gen; @@ -1476,8 +1465,10 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) { this->demux_class.open_plugin = open_demux_plugin; this->demux_class.description = N_("sputext demuxer plugin"); this->demux_class.identifier = "sputext"; - this->demux_class.get_mimetypes = get_demux_mimetypes; - this->demux_class.get_extensions = get_demux_extensions; + /* do not report this mimetype, it might confuse browsers. */ + /* "text/plain: asc txt sub srt: VIDEO subtitles;" */ + this->demux_class.mimetypes = NULL; + this->demux_class.extensions = "asc txt sub srt smi ssa"; this->demux_class.dispose = default_demux_class_dispose; /* -- cgit v1.2.3 From f77028285a231edada74b0d93e4198fa8179880e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 20:09:04 +0100 Subject: Rename METHOD_BY_EXTENSION to METHOD_BY_MRL, as it's used to identify protocols too. --- src/libsputext/demux_sputext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsputext') diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 0c9124786..69eb28388 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -1400,7 +1400,7 @@ static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_ this->buflen = 0; switch (stream->content_detection_method) { - case METHOD_BY_EXTENSION: + case METHOD_BY_MRL: { const char *const mrl = input->get_mrl(input); const char *const ending = strrchr(mrl, '.'); -- cgit v1.2.3