diff --git a/ChangeLog b/ChangeLog index ed5ddbffb8..375f46bb8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-05-18 Tim-Philipp Müller + + * tests/examples/helloworld/helloworld.c: (main): + Must plug audioconvert and audioresample between decoder + and audio sink. + 2006-05-17 Jan Schmidt * gst/gstregistryxml.c: (read_string), (load_pad_template), diff --git a/common b/common index 7a056f8737..8eb9ea4613 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 7a056f8737474de939f05f189e6ef0986a4b34c8 +Subproject commit 8eb9ea46137c34191bdbeca946ca4419ba573b51 diff --git a/tests/examples/helloworld/helloworld.c b/tests/examples/helloworld/helloworld.c index 0c2f3ac73e..bd6016ac59 100644 --- a/tests/examples/helloworld/helloworld.c +++ b/tests/examples/helloworld/helloworld.c @@ -41,6 +41,7 @@ int main (int argc, char *argv[]) { GstElement *bin, *filesrc, *decoder, *audiosink; + GstElement *conv, *resample; gst_init (&argc, &argv); @@ -64,15 +65,31 @@ main (int argc, char *argv[]) g_print ("could not find plugin \"mad\""); return -1; } + + /* also, we need to add some converters to make sure the audio stream + * from the decoder is converted into a format the audio sink can + * understand (if necessary) */ + conv = gst_element_factory_make ("audioconvert", "audioconvert"); + if (!conv) { + g_print ("could not create \"audioconvert\" element!"); + return -1; + } + resample = gst_element_factory_make ("audioresample", "audioresample"); + if (!conv) { + g_print ("could not create \"audioresample\" element!"); + return -1; + } + /* and an audio sink */ audiosink = gst_element_factory_make ("alsasink", "play_audio"); g_assert (audiosink); /* add objects to the main pipeline */ - gst_bin_add_many (GST_BIN (bin), filesrc, decoder, audiosink, NULL); + gst_bin_add_many (GST_BIN (bin), filesrc, decoder, conv, + resample, audiosink, NULL); /* link the elements */ - gst_element_link_many (filesrc, decoder, audiosink, NULL); + gst_element_link_many (filesrc, decoder, conv, resample, audiosink, NULL); /* start playing */ gst_element_set_state (bin, GST_STATE_PLAYING);