gst/playback/gstplaybin.c: Make playbin automatically plug an 'audioresample' element before the audio sink as well. ...

Original commit message from CVS:
* gst/playback/gstplaybin.c: (gen_audio_element):
Make playbin automatically plug an 'audioresample'
element before the audio sink as well. This solves
problems with sinks that only accept a very specific
sample rate, like esdsink (e.g. #340379).
This commit is contained in:
Tim-Philipp Müller 2006-05-11 18:06:18 +00:00
parent a2bf9eeca8
commit 7cae9d887f
2 changed files with 16 additions and 11 deletions

View file

@ -1,3 +1,11 @@
2006-05-11 Tim-Philipp Müller <tim at centricular dot net>
* gst/playback/gstplaybin.c: (gen_audio_element):
Make playbin automatically plug an 'audioresample'
element before the audio sink as well. This solves
problems with sinks that only accept a very specific
sample rate, like esdsink (e.g. #340379).
2006-05-11 Tim-Philipp Müller <tim at centricular dot net> 2006-05-11 Tim-Philipp Müller <tim at centricular dot net>
* gst/playback/gstplaybasebin.c: (gen_source_element): * gst/playback/gstplaybasebin.c: (gen_source_element):

View file

@ -751,10 +751,9 @@ gen_audio_element (GstPlayBin * play_bin)
{ {
GstElement *element; GstElement *element;
GstElement *conv; GstElement *conv;
GstElement *scale;
GstElement *sink; GstElement *sink;
GstElement *volume; GstElement *volume;
/* GstElement *scale; */
GstPad *pad; GstPad *pad;
element = g_hash_table_lookup (play_bin->cache, "abin"); element = g_hash_table_lookup (play_bin->cache, "abin");
@ -765,11 +764,11 @@ gen_audio_element (GstPlayBin * play_bin)
conv = gst_element_factory_make ("audioconvert", "aconv"); conv = gst_element_factory_make ("audioconvert", "aconv");
if (conv == NULL) if (conv == NULL)
goto no_audioconvert; goto no_audioconvert;
/*
scale = gst_element_factory_make ("audioresample", "aresample"); scale = gst_element_factory_make ("audioresample", "aresample");
if (scale == NULL) if (scale == NULL)
goto no_audioresample; goto no_audioresample;
*/
volume = gst_element_factory_make ("volume", "volume"); volume = gst_element_factory_make ("volume", "volume");
g_object_set (G_OBJECT (volume), "volume", play_bin->volume, NULL); g_object_set (G_OBJECT (volume), "volume", play_bin->volume, NULL);
play_bin->volume_element = volume; play_bin->volume_element = volume;
@ -793,12 +792,12 @@ gen_audio_element (GstPlayBin * play_bin)
g_hash_table_insert (play_bin->cache, "audio_sink", sink); g_hash_table_insert (play_bin->cache, "audio_sink", sink);
gst_bin_add (GST_BIN (element), conv); gst_bin_add (GST_BIN (element), conv);
/* gst_bin_add (GST_BIN (element), scale); */ gst_bin_add (GST_BIN (element), scale);
gst_bin_add (GST_BIN (element), volume); gst_bin_add (GST_BIN (element), volume);
gst_bin_add (GST_BIN (element), sink); gst_bin_add (GST_BIN (element), sink);
gst_element_link_pads (conv, "src", /*scale, "sink"); gst_element_link_pads (conv, "src", scale, "sink");
gst_element_link_pads (scale, "src", */ volume, "sink"); gst_element_link_pads (scale, "src", volume, "sink");
gst_element_link_pads (volume, "src", sink, "sink"); gst_element_link_pads (volume, "src", sink, "sink");
pad = gst_element_get_pad (conv, "sink"); pad = gst_element_get_pad (conv, "sink");
@ -822,17 +821,15 @@ no_audioconvert:
gst_object_unref (element); gst_object_unref (element);
return NULL; return NULL;
} }
/*
no_audioresample: no_audioresample:
{ {
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."), (_("Missing element '%s' - check your GStreamer installation."),
"audioresample"), "audioresample"), ("possibly a liboil version mismatch?"));
("possibly a liboil version mismatch?"));
gst_object_unref (element); gst_object_unref (element);
return NULL; return NULL;
} }
*/
} }
/* make the element (bin) that contains the elements needed to perform /* make the element (bin) that contains the elements needed to perform