mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
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.
This commit is contained in:
parent
5d5807c0d5
commit
3cb7f2a649
3 changed files with 18 additions and 2 deletions
2
test/a.c
2
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 */
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue