From 7cae9d887f378d74d8d6e7a81571dc2a43868e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 11 May 2006 18:06:18 +0000 Subject: [PATCH] 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). --- ChangeLog | 8 ++++++++ gst/playback/gstplaybin.c | 19 ++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1ff87037b..7fc10a1314 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-05-11 Tim-Philipp Müller + + * 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 * gst/playback/gstplaybasebin.c: (gen_source_element): diff --git a/gst/playback/gstplaybin.c b/gst/playback/gstplaybin.c index 33260c03e7..dcac5d9609 100644 --- a/gst/playback/gstplaybin.c +++ b/gst/playback/gstplaybin.c @@ -751,10 +751,9 @@ gen_audio_element (GstPlayBin * play_bin) { GstElement *element; GstElement *conv; + GstElement *scale; GstElement *sink; GstElement *volume; - - /* GstElement *scale; */ GstPad *pad; 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"); if (conv == NULL) goto no_audioconvert; -/* + scale = gst_element_factory_make ("audioresample", "aresample"); if (scale == NULL) goto no_audioresample; -*/ + volume = gst_element_factory_make ("volume", "volume"); g_object_set (G_OBJECT (volume), "volume", play_bin->volume, NULL); 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); 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), sink); - gst_element_link_pads (conv, "src", /*scale, "sink"); - gst_element_link_pads (scale, "src", */ volume, "sink"); + gst_element_link_pads (conv, "src", scale, "sink"); + gst_element_link_pads (scale, "src", volume, "sink"); gst_element_link_pads (volume, "src", sink, "sink"); pad = gst_element_get_pad (conv, "sink"); @@ -822,17 +821,15 @@ no_audioconvert: gst_object_unref (element); return NULL; } -/* + no_audioresample: { GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, (_("Missing element '%s' - check your GStreamer installation."), - "audioresample"), - ("possibly a liboil version mismatch?")); + "audioresample"), ("possibly a liboil version mismatch?")); gst_object_unref (element); return NULL; } -*/ } /* make the element (bin) that contains the elements needed to perform