gst/playback/: Handle case where we can't create the volume element a bit better (#514307).

Original commit message from CVS:
* gst/playback/gstplaybin.c: (gen_audio_element):
* gst/playback/gstplaysink.c: (gen_audio_chain):
Handle case where we can't create the volume element a bit
better (#514307).
This commit is contained in:
Tim-Philipp Müller 2008-02-11 18:31:43 +00:00
parent cb873f9527
commit 1d9e1d6a3d
3 changed files with 29 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2008-02-11 Tim-Philipp Müller <tim at centricular dot net>
* gst/playback/gstplaybin.c: (gen_audio_element):
* gst/playback/gstplaysink.c: (gen_audio_chain):
Handle case where we can't create the volume element a bit
better (#514307).
2008-02-11 Tim-Philipp Müller <tim at centricular dot net>
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_check_get_range):

View file

@ -1052,6 +1052,8 @@ gen_audio_element (GstPlayBin * play_bin)
gst_bin_add (GST_BIN_CAST (element), scale);
volume = gst_element_factory_make ("volume", "volume");
if (volume == NULL)
goto no_volume;
g_object_set (G_OBJECT (volume), "volume", play_bin->volume, NULL);
play_bin->volume_element = volume;
gst_bin_add (GST_BIN_CAST (element), volume);
@ -1092,7 +1094,6 @@ no_audioconvert:
gst_object_unref (element);
return NULL;
}
no_audioresample:
{
post_missing_element_message (play_bin, "audioresample");
@ -1102,6 +1103,15 @@ no_audioresample:
gst_object_unref (element);
return NULL;
}
no_volume:
{
post_missing_element_message (play_bin, "volume");
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."),
"volume"), ("possibly a liboil version mismatch?"));
gst_object_unref (element);
return NULL;
}
link_failed:
{
GST_ELEMENT_ERROR (play_bin, CORE, PAD,

View file

@ -946,6 +946,8 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw)
if (playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME) {
chain->volume = gst_element_factory_make ("volume", "volume");
if (chain->volume == NULL)
goto no_volume;
/* configure with the latest volume */
g_object_set (G_OBJECT (chain->volume), "volume", playsink->volume, NULL);
gst_bin_add (bin, chain->volume);
@ -987,7 +989,6 @@ no_audioconvert:
free_chain ((GstPlayChain *) chain);
return NULL;
}
no_audioresample:
{
post_missing_element_message (playsink, "audioresample");
@ -997,6 +998,15 @@ no_audioresample:
free_chain ((GstPlayChain *) chain);
return NULL;
}
no_volume:
{
post_missing_element_message (playsink, "volume");
GST_ELEMENT_ERROR (playsink, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."),
"volume"), ("possibly a liboil version mismatch?"));
free_chain ((GstPlayChain *) chain);
return NULL;
}
link_failed:
{
GST_ELEMENT_ERROR (playsink, CORE, PAD,