From 2696ee9c9016fb2213dbdfff53b61a80b0d0e60e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 4 May 2004 17:00:11 +0000 Subject: [PATCH] gst/parse/grammar.y: fix assert to not trigger when there's no error argument Original commit message from CVS: * gst/parse/grammar.y: fix assert to not trigger when there's no error argument * gst/parse/parse.l: fix definition of caps to allow more than two structures * testsuite/caps/Makefile.am: * testsuite/caps/renegotiate.c: (main): it's sinesrc and works in that case --- ChangeLog | 10 ++++++++++ gst/parse/grammar.y | 3 ++- gst/parse/parse.l | 2 +- tests/old/testsuite/caps/Makefile.am | 2 +- tests/old/testsuite/caps/renegotiate.c | 7 ++++--- testsuite/caps/Makefile.am | 2 +- testsuite/caps/renegotiate.c | 7 ++++--- 7 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index fca09aa538..89b6aa812c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-05-04 Benjamin Otte + + * gst/parse/grammar.y: + fix assert to not trigger when there's no error argument + * gst/parse/parse.l: + fix definition of caps to allow more than two structures + * testsuite/caps/Makefile.am: + * testsuite/caps/renegotiate.c: (main): + it's sinesrc and works in that case + 2004-05-04 Wim Taymans * gst/schedulers/gstoptimalscheduler.c: (remove_from_group), diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index 11cac7be97..53ec94550b 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -912,7 +912,8 @@ error1: g_slist_foreach (g.links, (GFunc)gst_parse_free_link, NULL); g_slist_free (g.links); - g_assert (*error); + if (error) + g_assert (*error); ret = NULL; goto out; diff --git a/gst/parse/parse.l b/gst/parse/parse.l index 0b9e24a9b4..14b4f2229f 100644 --- a/gst/parse/parse.l +++ b/gst/parse/parse.l @@ -46,7 +46,7 @@ _mimetype ({_mimechar}+"/"{_mimechar}+)|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\ _capschar ("\\".)|([^\;!]) _capsstring {_capschar}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'") _caps {_mimetype}(","[^!]|{_capsstring})* -_link ("!"[[:space:]]*{_caps}([[:space:]]*";"[[:space:]]*{_caps})*[[:space:]]*"!")|("!") +_link ("!"[[:space:]]*{_caps}([[:space:]]*(";"[[:space:]]*{_caps})*[[:space:]]*)*"!")|("!") %x value %option noyywrap diff --git a/tests/old/testsuite/caps/Makefile.am b/tests/old/testsuite/caps/Makefile.am index 0ecf19c117..a934d86b8e 100644 --- a/tests/old/testsuite/caps/Makefile.am +++ b/tests/old/testsuite/caps/Makefile.am @@ -28,7 +28,7 @@ EXTRA_DIST = caps_strings noinst_HEADERS = \ caps.h -tests_fail = renegotiate +tests_fail = tests_ignore = app_fixate_LDADD = $(GST_OBJ_LIBS) diff --git a/tests/old/testsuite/caps/renegotiate.c b/tests/old/testsuite/caps/renegotiate.c index 183fcfaa14..6265a6b059 100644 --- a/tests/old/testsuite/caps/renegotiate.c +++ b/tests/old/testsuite/caps/renegotiate.c @@ -60,15 +60,16 @@ main (int argc, char *argv[]) const GList *l2; int i; int ret; + GError *error = NULL; gst_init (&argc, &argv); /* change sinesrk to sinesrc once gst_parse_launch is fixed */ - pipeline = gst_parse_launch ("sinesrk ! audioconvert ! " + pipeline = gst_parse_launch ("sinesrc ! audioconvert ! " "audio/x-raw-int, channels=2, rate=48000;" - "audio/x-raw-int, channels=1, rate=44100 !" "fakesink", NULL); + "audio/x-raw-int, channels=1, rate=44100 !" "fakesink", &error); - if (pipeline == NULL) { + if (error != NULL) { g_print ("oops, couldn't build pipeline. You probably don't have audioconvert or sinesrc\n"); exit (0); diff --git a/testsuite/caps/Makefile.am b/testsuite/caps/Makefile.am index 0ecf19c117..a934d86b8e 100644 --- a/testsuite/caps/Makefile.am +++ b/testsuite/caps/Makefile.am @@ -28,7 +28,7 @@ EXTRA_DIST = caps_strings noinst_HEADERS = \ caps.h -tests_fail = renegotiate +tests_fail = tests_ignore = app_fixate_LDADD = $(GST_OBJ_LIBS) diff --git a/testsuite/caps/renegotiate.c b/testsuite/caps/renegotiate.c index 183fcfaa14..6265a6b059 100644 --- a/testsuite/caps/renegotiate.c +++ b/testsuite/caps/renegotiate.c @@ -60,15 +60,16 @@ main (int argc, char *argv[]) const GList *l2; int i; int ret; + GError *error = NULL; gst_init (&argc, &argv); /* change sinesrk to sinesrc once gst_parse_launch is fixed */ - pipeline = gst_parse_launch ("sinesrk ! audioconvert ! " + pipeline = gst_parse_launch ("sinesrc ! audioconvert ! " "audio/x-raw-int, channels=2, rate=48000;" - "audio/x-raw-int, channels=1, rate=44100 !" "fakesink", NULL); + "audio/x-raw-int, channels=1, rate=44100 !" "fakesink", &error); - if (pipeline == NULL) { + if (error != NULL) { g_print ("oops, couldn't build pipeline. You probably don't have audioconvert or sinesrc\n"); exit (0);