From 9f911a4387602eba171b314e3cfe02ce0deabf60 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Mon, 24 Dec 2007 18:58:26 +0000 Subject: Consistently use "colour", "colour key", "colour space" in output. Some instances of "key colour" remain; ffmpeg is unmodified. This change has caused two strings with two translations to collide (the strings have become identical since some instances already used "colour"). I have therefore arbitrarily dropped the first of the differing translations, the one for the string at src/video_out/video_out_directfb.c:1365. --- src/xine-engine/alphablend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/alphablend.c b/src/xine-engine/alphablend.c index 8fcc4c469..a7ab33cf8 100644 --- a/src/xine-engine/alphablend.c +++ b/src/xine-engine/alphablend.c @@ -1959,7 +1959,7 @@ static int xx44_paletteIndex(xx44_palette_t *p, int color, uint32_t clut) } if (p->max_used == p->size -1) { - printf("video_out: Warning! Out of xx44 palette colors!\n"); + printf("video_out: Warning! Out of xx44 palette colours!\n"); return 1; } p->cluts[p->max_used] = clut; -- cgit v1.2.3 From 84e2f56c6cc81e9bed8ba03b29a8c69aa7d08d89 Mon Sep 17 00:00:00 2001 From: Dubois Nicolas Date: Thu, 27 Dec 2007 14:24:48 +0000 Subject: [Subtitles] SSA-tags patch I watch a lot of movies with subtitles and I need "vobsub subtitles" work in xine, then I decide to write this patch. It may support SSA tags for all text subtiles (ssa, ass, srt, ...) This patch : 1. Remove all SSA tags from stream (they are ugly : {\a6}) 2. Handle some of them (b, i, a, an, pos). The other ones control colours, shadow, animation, ... I can't make them work in an easy way. 3. Correct wrap algorithm which have minors bugs (we can see them only with SSA patch...) Modified files : libsputext/demux_sputext.c just remove unneeded code (which remove some of SSA-tags) libsputext/xine_sputext_decoder.c the main modified file. video_out/video_out_xshm.c video_out/video_out_xv.c xine-engine/video_out.h get video output (position and size). See below. 1. Removing SSA tags is done in ogm_render_line_internal() like for html-like tags. (this was done in the previous version of xine) 2. b(bold) and i(italic) are implemented like html-ones, in ogm_render_line_internal(). The other tags this patch support are : aX : alignment in SSA-code anX : alignment in numpad code pos(X,Y) : position, depend on alignment For those ones, I need in first a full-screen OSD, not a five lines one. Then, I need to remember where the last subtitle was drawn, in order to erase it. At last, I need a translation function to convert subtitle coordinates in screen coordinates. For this last point, I first write a full-screen translation (don't care about blacks borders), but it's not really good: the 'pos' tag is sometime used to point out something in the video. (Moreover, ASS spec say we have to draw subtitle on the video) For doing this, I need the real video output size and position, which are only know by the video output driver! Then I had 4 VO properties (in xine-engine/video_out.h) for video driver could give us those informations. I implement it only in xshm and xv drivers (I can't test other ones). If video driver can't give us those informations, the patch fallback in a full-screen translation. 3. there was 3 problem with the wrap algorithm : 1. It was in double: exactly the same, twice. Look like a merge problem. I remove one and all work fine. 2. It want to cut string in equivalent display length but it cut it in equivalent byte length. In most cases, this is the same, but if we have UTF-8 chars or long SSA-tags (which will not be displayed) the result is strange. 3. If we have a too-long part (in bytes) of the string without spaces (bad subtitle file or long SSA-code), the algorithm don't know what to do. (this case is not handled) I re-write the wrap algorithm to correct those problems. Note that my version is slower than previous one : working with bytes is really faster than computing text-length. Maybe I should had to propose an other patch for this part... --- src/xine-engine/video_out.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 308e809f1..4d9c80565 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/video_out.h @@ -245,7 +245,11 @@ struct xine_video_port_s { #define VO_PROP_WINDOW_HEIGHT 16 /* read-only */ #define VO_PROP_BUFS_IN_FIFO 17 /* read-only */ #define VO_PROP_NUM_STREAMS 18 /* read-only */ -#define VO_NUM_PROPERTIES 19 +#define VO_PROP_OUTPUT_WIDTH 19 /* read-only */ +#define VO_PROP_OUTPUT_HEIGHT 20 /* read-only */ +#define VO_PROP_OUTPUT_XOFFSET 21 /* read-only */ +#define VO_PROP_OUTPUT_YOFFSET 22 /* read-only */ +#define VO_NUM_PROPERTIES 23 /* number of colors in the overlay palette. Currently limited to 256 at most, because some alphablend functions use an 8-bit index into -- cgit v1.2.3 From 172de9bf22cb530e56335f42b983a69057e0cdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sun, 23 Dec 2007 16:13:03 +0100 Subject: Make std_explanation a truly const array. --- src/xine-engine/xine_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index 32b8663a6..c731a936f 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.c @@ -941,7 +941,7 @@ int _x_message(xine_stream_t *stream, int type, ...) { va_list ap; char *s, *params; char *args[1025]; - static const char *std_explanation[] = { + static const char *const std_explanation[] = { "", N_("Warning:"), N_("Unknown host:"), -- cgit v1.2.3 From a6b72ecda7a25bffd0dfe4b654fcce815a146105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sun, 23 Dec 2007 16:16:40 +0100 Subject: Mark more array as constants. --- src/xine-engine/audio_out.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 39e3cd1a4..5162c1883 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -2045,8 +2045,8 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int i, err; pthread_attr_t pth_attrs; pthread_mutexattr_t attr; - static const char* resample_modes[] = {"auto", "off", "on", NULL}; - static const char* av_sync_methods[] = {"metronom feedback", "resample", NULL}; + static const char *const resample_modes[] = {"auto", "off", "on", NULL}; + static const char *const av_sync_methods[] = {"metronom feedback", "resample", NULL}; this = xine_xmalloc (sizeof (aos_t)) ; -- cgit v1.2.3 From bc8c21fd7f45233fe6501e4e9a21b33a0c498248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sun, 23 Dec 2007 17:03:04 +0100 Subject: Make supported_types constant, change plugins' loading code so that it actually load them properly. --- src/xine-engine/load_plugins.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 7a6237b79..f641281d8 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1022,15 +1022,16 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) { vo_info->visual_type = i; } else if( !strcmp("supported_types",line) && decoder_info ) { char *s; + uint32_t *supported_types; for( s = value, i = 0; s && sscanf(s," %lu",&lu) > 0; i++ ) { s = strchr(s+1, ' '); } - decoder_info->supported_types = xine_xcalloc((i+1), sizeof(uint32_t)); - for( s = value, i = 0; s && sscanf(s," %lu",&lu) > 0; i++ ) { - decoder_info->supported_types[i] = lu; + supported_types = xine_xcalloc((i+1), sizeof(uint32_t)); + for( s = value, i = 0; s && sscanf(s," %"SCNu32,&supported_types[i]) > 0; i++ ) { s = strchr(s+1, ' '); } + decoder_info->supported_types = supported_types; } else if( !strcmp("vo_priority",line) && vo_info ) { sscanf(value," %d",&i); vo_info->priority = i; -- cgit v1.2.3 From d0c98ed5d0fe24ddff6ec51829fe54eedee23fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sun, 23 Dec 2007 18:26:08 +0100 Subject: Mark open_internal static (again?). --- src/xine-engine/xine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index ec2dc9170..48fb46958 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -820,7 +820,7 @@ void _x_flush_events_queues (xine_stream_t *stream) { pthread_mutex_unlock (&stream->event_queues_lock); } -/*static*/ int open_internal (xine_stream_t *stream, const char *mrl) { +static int open_internal (xine_stream_t *stream, const char *mrl) { const char *stream_setup = NULL; int no_cache = 0; -- cgit v1.2.3 From a6a44d3e64f6b32ce53128937c8bb894fce4644d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sun, 23 Dec 2007 19:01:18 +0100 Subject: Don't create extra variables now that node is transparent to xine's build. --- src/xine-engine/load_plugins.c | 9 +++------ src/xine-engine/post.c | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index f641281d8..5f0da4cff 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1254,10 +1254,9 @@ input_plugin_t *_x_find_input_plugin (xine_stream_t *stream, const char *mrl) { void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) { plugin_catalog_t *catalog = stream->xine->plugin_catalog; - plugin_node_t *node = input->node; input->dispose(input); - if (node) { + if (input->node) { pthread_mutex_lock(&catalog->lock); dec_node_ref(node); pthread_mutex_unlock(&catalog->lock); @@ -1476,10 +1475,9 @@ demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const cha void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) { plugin_catalog_t *catalog = stream->xine->plugin_catalog; - plugin_node_t *node = demux->node; demux->dispose(demux); - if (node) { + if (demux->node) { pthread_mutex_lock(&catalog->lock); dec_node_ref(node); pthread_mutex_unlock(&catalog->lock); @@ -1971,11 +1969,10 @@ video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_typ void _x_free_video_decoder (xine_stream_t *stream, video_decoder_t *vd) { plugin_catalog_t *catalog = stream->xine->plugin_catalog; - plugin_node_t *node = vd->node; vd->dispose (vd); - if (node) { + if (vd->node) { pthread_mutex_lock (&catalog->lock); dec_node_ref(node); pthread_mutex_unlock (&catalog->lock); diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c index e057ff99f..651bb10f3 100644 --- a/src/xine-engine/post.c +++ b/src/xine-engine/post.c @@ -891,7 +891,7 @@ int _x_post_dispose(post_plugin_t *this) { /* since the plugin loader does not know, when the plugin gets disposed, * we have to handle the reference counter here */ pthread_mutex_lock(&this->xine->plugin_catalog->lock); - ((plugin_node_t *)this->node)->ref--; + this->node->ref--; pthread_mutex_unlock(&this->xine->plugin_catalog->lock); return 1; -- cgit v1.2.3 From 453657754e29a47664b4da9c146a5306e5da136b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sun, 23 Dec 2007 19:11:43 +0100 Subject: Compile fix. --- src/xine-engine/load_plugins.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 5f0da4cff..b0f0d708a 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1258,7 +1258,7 @@ void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) { input->dispose(input); if (input->node) { pthread_mutex_lock(&catalog->lock); - dec_node_ref(node); + dec_node_ref(input->node); pthread_mutex_unlock(&catalog->lock); } } @@ -1479,7 +1479,7 @@ void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) { demux->dispose(demux); if (demux->node) { pthread_mutex_lock(&catalog->lock); - dec_node_ref(node); + dec_node_ref(demux->node); pthread_mutex_unlock(&catalog->lock); } } @@ -1974,7 +1974,7 @@ void _x_free_video_decoder (xine_stream_t *stream, video_decoder_t *vd) { if (vd->node) { pthread_mutex_lock (&catalog->lock); - dec_node_ref(node); + dec_node_ref(vd->node); pthread_mutex_unlock (&catalog->lock); } } -- cgit v1.2.3 From 35f0e9716e95fa71a1a7a6a471bb57c55a971d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sun, 23 Dec 2007 21:06:17 +0100 Subject: Mark xine_dispose_internal static. --- src/xine-engine/xine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 48fb46958..f473271ea 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -591,7 +591,7 @@ static int stream_rewire_video(xine_post_out_t *output, void *data) return 1; } -void xine_dispose_internal (xine_stream_t *stream); +static void xine_dispose_internal (xine_stream_t *stream); xine_stream_t *xine_stream_new (xine_t *this, xine_audio_port_t *ao, xine_video_port_t *vo) { @@ -1445,7 +1445,7 @@ int xine_eject (xine_stream_t *stream) { return status; } -void xine_dispose_internal (xine_stream_t *stream) { +static void xine_dispose_internal (xine_stream_t *stream) { xine_list_iterator_t *ite; -- cgit v1.2.3 From 0e5934002fd660a25d844d0f11fa7d2e53a10297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Mon, 24 Dec 2007 15:24:15 +0100 Subject: Move _x_scan_plugins and _x_dispose_plugins into an internal header, and don't export them anymore. --- src/xine-engine/Makefile.am | 3 ++- src/xine-engine/load_plugins.c | 2 ++ src/xine-engine/load_plugins.h | 50 ++++++++++++++++++++++++++++++++++++++++++ src/xine-engine/xine.c | 2 ++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 src/xine-engine/load_plugins.h (limited to 'src/xine-engine') diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index c509b62af..49757f841 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -24,7 +24,8 @@ libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \ video_overlay.c osd.c spu.c scratch.c demux.c vo_scale.c \ xine_interface.c post.c broadcaster.c io_helper.c \ input_rip.c input_cache.c info_helper.c refcounter.c \ - alphablend.c + alphablend.c \ + load_plugins.h libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) $(XDG_BASEDIR_DEPS) \ $(pthread_dep) $(LIBXINEPOSIX) diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index b0f0d708a..eae30efe4 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -42,6 +42,8 @@ #include +#include "load_plugins.h" + #define LOG_MODULE "load_plugins" #define LOG_VERBOSE diff --git a/src/xine-engine/load_plugins.h b/src/xine-engine/load_plugins.h new file mode 100644 index 000000000..7e7d3cc93 --- /dev/null +++ b/src/xine-engine/load_plugins.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2007 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +/** + * @file + * @brief Internal functions related to the plugin catalog. + * + * @internal This code should not be used by plugins or frontends, it's only + * used by the xine-engine. + */ + +#ifndef __LOAD_PLUGINS_H__ +#define __LOAD_PLUGINS_H__ + +#include + +/* + * load plugins into catalog + * + * all input+demux plugins will be fully loaded+initialized + * decoder plugins are loaded on demand + * video/audio output plugins have special load/probe functions + */ +void _x_scan_plugins (xine_t *this); + + +/* + * dispose all currently loaded plugins (shutdown) + */ + +void _x_dispose_plugins (xine_t *this); + +#endif diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index f473271ea..3da311dfc 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -79,6 +79,8 @@ # include #endif /* WIN32 */ +#include "load_plugins.h" + static void mutex_cleanup (void *mutex) { pthread_mutex_unlock ((pthread_mutex_t *) mutex); -- cgit v1.2.3 From 6dbb05a4cba3cdc811308762058d722f11464683 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 30 Dec 2007 15:55:03 +0000 Subject: =?UTF-8?q?Manual=20port=20of=20the=20color=E2=86=92colour=20chang?= =?UTF-8?q?e=20to=201.2;=20should=20make=20merging=20easier.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/xine-engine/alphablend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/alphablend.c b/src/xine-engine/alphablend.c index c47257273..41715decb 100644 --- a/src/xine-engine/alphablend.c +++ b/src/xine-engine/alphablend.c @@ -1959,7 +1959,7 @@ static int xx44_paletteIndex(xx44_palette_t *p, int color, uint32_t clut) } if (p->max_used == p->size -1) { - printf("video_out: Warning! Out of xx44 palette colors!\n"); + printf("video_out: Warning! Out of xx44 palette colours!\n"); return 1; } p->cluts[p->max_used] = clut; -- cgit v1.2.3 From 158c5f2072b8a67a0c9e8d8523908a9d89188b1c Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Tue, 1 Jan 2008 02:29:17 +0000 Subject: Skip deleted keys - should any ever occur! - while saving the config. --- src/xine-engine/configfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 2f5e6214a..2dc89f0af 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -1060,7 +1060,7 @@ void xine_config_save (xine_t *xine, const char *filename) { if (!entry->key[0]) /* deleted key */ - continue; + goto next; lprintf ("saving key '%s'\n", entry->key); @@ -1130,6 +1130,7 @@ void xine_config_save (xine_t *xine, const char *filename) { break; } + next: entry = entry->next; } pthread_mutex_unlock(&this->config_lock); -- cgit v1.2.3 From 1406457b847cac6b63d4d670833e5e47f35b8cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 2 Jan 2008 18:55:25 +0100 Subject: Make _x_vo_scape_aspect_ratio_name return a constant string. Note that this should probably be replaced with a const string table. --- src/xine-engine/vo_scale.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c index 5da5ab26e..bae84ea96 100644 --- a/src/xine-engine/vo_scale.c +++ b/src/xine-engine/vo_scale.c @@ -315,7 +315,8 @@ void _x_vo_scale_translate_gui2video(vo_scale_t *this, * Returns description of a given ratio code */ -char *_x_vo_scale_aspect_ratio_name(int a) { +const char *_x_vo_scale_aspect_ratio_name(int a) { + /* TODO replace this with a string table */ switch (a) { case XINE_VO_ASPECT_AUTO: -- cgit v1.2.3 From 4d3bae2eb3d5077f390ad3eebffaa39fe760f3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 2 Jan 2008 19:00:10 +0100 Subject: Update broadcaster functions to accept constant strings. --- src/xine-engine/broadcaster.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/broadcaster.c b/src/xine-engine/broadcaster.c index 71d466c3a..2157f0550 100644 --- a/src/xine-engine/broadcaster.c +++ b/src/xine-engine/broadcaster.c @@ -136,7 +136,7 @@ static int sock_data_write(xine_t *xine, int socket, void *buf_gen, int len) { } static int XINE_FORMAT_PRINTF(3, 4) -sock_string_write(xine_t *xine, int socket, char *msg, ...) { +sock_string_write(xine_t *xine, int socket, const char *msg, ...) { char buf[_BUFSIZ]; va_list args; @@ -178,7 +178,7 @@ static void broadcaster_data_write(broadcaster_t *this, void *buf, int len) { } static void XINE_FORMAT_PRINTF(2, 3) -broadcaster_string_write(broadcaster_t *this, char *msg, ...) { +broadcaster_string_write(broadcaster_t *this, const char *msg, ...) { char buf[_BUFSIZ]; va_list args; @@ -248,7 +248,7 @@ static void *manager_loop (void *this_gen) { /* * receive xine buffers and send them through the broadcaster */ -static void send_buf (broadcaster_t *this, char *from, buf_element_t *buf) { +static void send_buf (broadcaster_t *this, const char *from, buf_element_t *buf) { int i; /* ignore END buffers since they would stop the slavery */ -- cgit v1.2.3 From 5e136f7de2c0bc943edf7ac4d7cfadc10ce8c4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 2 Jan 2008 19:00:37 +0100 Subject: The config translator returns a non-constant string. --- src/xine-engine/configfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 91931eef6..3e3c0f7b5 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -347,7 +347,7 @@ static void config_remove(config_values_t *this, cfg_entry_t *entry, cfg_entry_t prev->next = entry->next; } -static const char *config_xlate_internal (const char *key, const xine_config_entry_translation_t *trans) +static char *config_xlate_internal (const char *key, const xine_config_entry_translation_t *trans) { --trans; while ((++trans)->old_name) -- cgit v1.2.3 From 187be960c88a4f9839d6f5109d16f832980cee04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 2 Jan 2008 19:04:16 +0100 Subject: The id is constant, mostly. --- src/xine-engine/load_plugins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index eae30efe4..b179a135d 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1659,7 +1659,7 @@ xine_video_port_t *xine_new_framegrab_video_port (xine_t *this) { xine_video_port_t *port; vo_info_t *vo_info; plugin_catalog_t *catalog = this->plugin_catalog; - char *id; + const char *id; int list_id, list_size; driver = NULL; -- cgit v1.2.3 From 760c9b664fb211d720111b2e462092180acae44c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Thu, 3 Jan 2008 01:25:57 +0100 Subject: Replace _x_vo_scale_aspect_ratio_name() function with a string table, all the uses already check for the index not to go over ther expected one. --- src/xine-engine/vo_scale.c | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c index bae84ea96..567b3984a 100644 --- a/src/xine-engine/vo_scale.c +++ b/src/xine-engine/vo_scale.c @@ -311,29 +311,21 @@ void _x_vo_scale_translate_gui2video(vo_scale_t *this, *vid_y = y; } -/* - * Returns description of a given ratio code +/*/ + * @brief Table for description of a given ratio code. + * + * @note changing the size of the elements of the array will break + * ABI, so please don't do that unless you absolutely can't continue + * with the current size. */ - -const char *_x_vo_scale_aspect_ratio_name(int a) { - /* TODO replace this with a string table */ - - switch (a) { - case XINE_VO_ASPECT_AUTO: - return "auto"; - case XINE_VO_ASPECT_SQUARE: - return "square"; - case XINE_VO_ASPECT_4_3: - return "4:3"; - case XINE_VO_ASPECT_ANAMORPHIC: - return "16:9"; - case XINE_VO_ASPECT_DVB: - return "2:1"; - default: - return "unknown"; - } -} - +const char _x_vo_scale_aspect_ratio_name_table[][8] = { + "auto", /* XINE_VO_ASPECT_AUTO */ + "square", /* XINE_VO_ASPECT_SQUARE */ + "4:3", /* XINE_VO_ASPECT_4_3 */ + "16:9", /* XINE_VO_ASPECT_ANAMORPHIC */ + "2:1", /* XINE_VO_ASPECT_DVB */ + "unknown" /* All the rest */ +}; /* * config callbacks -- cgit v1.2.3