ext/: - a library should not call setlocale. see Libraries node in gettext manual

Original commit message from CVS:

* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/cdparanoia/gstcdparanoiasrc.c:
(gst_cd_paranoia_src_base_init), (plugin_init):
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_plugin_init):
- a library should not call setlocale. see Libraries node in
gettext manual
- make sure all plugins that use translation do bindtextdomain
to point to the localedir
* gst/playback/gstplaybin.c: (gen_vis_element), (add_sink),
(setup_sinks), (plugin_init):
all this, and check for NULL when creating sinks
This commit is contained in:
Thomas Vander Stichele 2006-01-27 01:06:29 +00:00
parent 4e84080336
commit 4f10b0983d
6 changed files with 66 additions and 10 deletions

View file

@ -1,3 +1,18 @@
2006-01-27 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/cdparanoia/gstcdparanoiasrc.c:
(gst_cd_paranoia_src_base_init), (plugin_init):
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_plugin_init):
- a library should not call setlocale. see "Libraries" node in
gettext manual
- make sure all plugins that use translation do bindtextdomain
to point to the localedir
* gst/playback/gstplaybin.c: (gen_vis_element), (add_sink),
(setup_sinks), (plugin_init):
all this, and check for NULL when creating sinks
2006-01-27 Julien MOUTTE <julien@moutte.net>
* gst/subparse/gstsubparse.c: (gst_subparse_type_find),

View file

@ -27,6 +27,8 @@
#include "gstalsasrc.h"
#include "gstalsamixerelement.h"
#include <gst/gst-i18n-plugin.h>
GST_DEBUG_CATEGORY (alsa_debug);
/* ALSA debugging wrapper */
@ -67,6 +69,13 @@ plugin_init (GstPlugin * plugin)
return FALSE;
GST_DEBUG_CATEGORY_INIT (alsa_debug, "alsa", 0, "alsa plugins");
#if ENABLE_NLS
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
#endif
err = snd_lib_error_set_handler (gst_alsa_error_wrapper);
if (err != 0)
GST_WARNING ("failed to set alsa error handler");

View file

@ -97,9 +97,6 @@ gst_cd_paranoia_src_base_init (gpointer g_class)
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &cdparanoia_details);
GST_DEBUG_CATEGORY_INIT (gst_cd_paranoia_src_debug, "cdparanoiasrc", 0,
"CD Paranoia Source");
}
static void
@ -389,10 +386,20 @@ gst_cd_paranoia_src_get_property (GObject * object, guint prop_id,
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (gst_cd_paranoia_src_debug, "cdparanoiasrc", 0,
"CD Paranoia Source");
if (!gst_element_register (plugin, "cdparanoiasrc", GST_RANK_SECONDARY,
GST_TYPE_CD_PARANOIA_SRC))
return FALSE;
#ifdef ENABLE_NLS
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
#endif
return TRUE;
}

View file

@ -89,7 +89,9 @@ plugin_init (GstPlugin * plugin)
return FALSE;
#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
/* FIXME: add category
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE, LOCALEDIR);
*/
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
#endif /* ENABLE_NLS */

View file

@ -2709,6 +2709,12 @@ gst_ogg_demux_plugin_init (GstPlugin * plugin)
GST_DEBUG_CATEGORY_INIT (gst_ogg_demux_setup_debug, "oggdemux_setup", 0,
"ogg demuxer setup stage when parsing pipeline");
#if ENABLE_NLS
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
#endif
return gst_element_register (plugin, "oggdemux", GST_RANK_PRIMARY,
GST_TYPE_OGG_DEMUX);
}

View file

@ -689,7 +689,7 @@ gen_text_element (GstPlayBin * play_bin)
}
/* make the element (bin) that contains the elements needed to perform
* audio playback.
* audio playback.
*
* +-------------------------------------------------------------+
* | abin |
@ -699,7 +699,7 @@ gen_text_element (GstPlayBin * play_bin)
* | | +---------+ +----------+ +---------+ +---------+ |
* sink-+ |
* +-------------------------------------------------------------+
*
*
*/
static GstElement *
gen_audio_element (GstPlayBin * play_bin)
@ -799,15 +799,21 @@ gen_vis_element (GstPlayBin * play_bin)
GstElement *vqueue, *aqueue;
GstPad *pad, *rpad;
asink = gen_audio_element (play_bin);
if (!asink)
return NULL;
vsink = gen_video_element (play_bin);
if (!vsink) {
gst_object_unref (asink);
return NULL;
}
element = gst_bin_new ("visbin");
tee = gst_element_factory_make ("tee", "tee");
vqueue = gst_element_factory_make ("queue", "vqueue");
aqueue = gst_element_factory_make ("queue", "aqueue");
asink = gen_audio_element (play_bin);
vsink = gen_video_element (play_bin);
gst_bin_add (GST_BIN (element), asink);
gst_bin_add (GST_BIN (element), vqueue);
gst_bin_add (GST_BIN (element), aqueue);
@ -956,6 +962,7 @@ add_sink (GstPlayBin * play_bin, GstElement * sink, GstPad * srcpad)
GstElement *parent;
GstStateChangeReturn stateret;
g_return_val_if_fail (sink != NULL, FALSE);
/* this is only for debugging */
parent = gst_pad_get_parent_element (srcpad);
if (parent) {
@ -1028,7 +1035,7 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group)
if (play_bin->sinks) {
remove_sinks (play_bin);
}
GST_DEBUG ("setupsinks");
GST_DEBUG_OBJECT (play_base_bin, "setupsinks");
/* find out what to do */
if (group->type[GST_STREAM_TYPE_VIDEO - 1].npads > 0 &&
@ -1058,6 +1065,8 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group)
} else {
sink = gen_audio_element (play_bin);
}
if (!sink)
return FALSE;
pad = gst_element_get_pad (group->type[GST_STREAM_TYPE_AUDIO - 1].preroll,
"src");
res = add_sink (play_bin, sink, pad);
@ -1079,6 +1088,8 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group)
} else {
sink = gen_video_element (play_bin);
}
if (!sink)
return FALSE;
pad = gst_element_get_pad (group->type[GST_STREAM_TYPE_VIDEO - 1].preroll,
"src");
res = add_sink (play_bin, sink, pad);
@ -1243,6 +1254,12 @@ plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (gst_play_bin_debug, "playbin", 0, "play bin");
#ifdef ENABLE_NLS
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
#endif /* ENABLE_NLS */
return gst_element_register (plugin, "playbin", GST_RANK_NONE,
GST_TYPE_PLAY_BIN);
}