From 3cb7f2a649f47310d986bfec00d9fb3996c77e20 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 5 Feb 2000 01:20:11 +0000 Subject: [PATCH] Fixed a nasty bug in mp3parse (partial buffer state remained) Original commit message from CVS: Fixed a nasty bug in mp3parse (partial buffer state remained) Added eos check for the test programs to stop them from allocating all of your memory (had to use alt-sysreq-k a few times :-( ). MPEG layer 1 plays fine now with mp3play. --- test/a.c | 2 +- test/mp3parse.c | 10 +++++++++- test/mp3play.c | 8 ++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/test/a.c b/test/a.c index 59ad5d6a59..6e7aa47d00 100644 --- a/test/a.c +++ b/test/a.c @@ -44,7 +44,7 @@ int main(int argc,char *argv[]) { audiosink = gst_audiosink_new("audiosink"); - gtk_signal_connect(GTK_OBJECT(disksrc),"eof", + gtk_signal_connect(GTK_OBJECT(disksrc),"eos", GTK_SIGNAL_FUNC(eof),NULL); /* add objects to the main pipeline */ diff --git a/test/mp3parse.c b/test/mp3parse.c index 284601f596..d7cf51cbf5 100644 --- a/test/mp3parse.c +++ b/test/mp3parse.c @@ -2,8 +2,13 @@ extern gboolean _gst_plugin_spew; +void eof(GstSrc *src) { + g_print("have eof, quitting\n"); + exit(0); +} + void mp3parse_info_chain(GstPad *pad,GstBuffer *buf) { - g_print("got buffer of size %d\n",GST_BUFFER_SIZE(buf)); + g_print("sink : got buffer of size %d\n",GST_BUFFER_SIZE(buf)); gst_buffer_unref(buf); } @@ -41,6 +46,9 @@ int main(int argc,char *argv[]) { gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src)); gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(parse)); + gtk_signal_connect(GTK_OBJECT(src),"eos", + GTK_SIGNAL_FUNC(eof),NULL); + gst_pad_connect(gst_element_get_pad(src,"src"), gst_element_get_pad(parse,"sink")); gst_pad_connect(gst_element_get_pad(parse,"src"), diff --git a/test/mp3play.c b/test/mp3play.c index 4f00807693..7e3c0a2a13 100644 --- a/test/mp3play.c +++ b/test/mp3play.c @@ -2,6 +2,11 @@ extern gboolean _gst_plugin_spew; +void eof(GstSrc *src) { + g_print("have eof, quitting\n"); + exit(0); +} + int main(int argc,char *argv[]) { GstPipeline *pipeline; GstElementFactory *srcfactory, *parsefactory, *decodefactory, *playfactory; @@ -38,6 +43,9 @@ int main(int argc,char *argv[]) { play = gst_elementfactory_create(playfactory,"play"); g_return_if_fail(play != NULL); + gtk_signal_connect(GTK_OBJECT(src),"eos", + GTK_SIGNAL_FUNC(eof),NULL); + gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src)); gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(parse)); gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(decode));