summaryrefslogtreecommitdiff
path: root/tools/gst-typefind.c
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2003-09-14 11:08:50 +0000
committerDavid Schleef <ds@schleef.org>2003-09-14 11:08:50 +0000
commitb4993b3de21c62882d8b6819024800e25d66f65f (patch)
treec92078e85a469099086988fd6ac0882f4219d201 /tools/gst-typefind.c
parentb3e15a8f711f11c3d4d76aa70c64fd5c367aa986 (diff)
Use gst_caps_to_string to print caps. Add max_iterations.
Original commit message from CVS: Use gst_caps_to_string to print caps. Add max_iterations.
Diffstat (limited to 'tools/gst-typefind.c')
-rw-r--r--tools/gst-typefind.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/gst-typefind.c b/tools/gst-typefind.c
index 9f34c2840..fd6571362 100644
--- a/tools/gst-typefind.c
+++ b/tools/gst-typefind.c
@@ -12,17 +12,13 @@
**/
gboolean FOUND = FALSE;
+int iterations;
+int max_iterations = 100;
void
gst_caps_print (GstCaps *caps)
{
- while (caps) {
- g_print ("%s (%s)\n", caps->name, gst_caps_get_mime (caps));
- if (caps->properties) {
- g_print ("has properties\n");
- }
- caps = caps->next;
- }
+ g_print ("%s\n", gst_caps_to_string (caps));
}
void
@@ -61,7 +57,13 @@ main (int argc, char *argv[])
/* set to play */
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
- while (gst_bin_iterate (GST_BIN (pipeline)) && !FOUND) ;
+ while (!FOUND){
+ gst_bin_iterate (GST_BIN (pipeline));
+ iterations++;
+ if(iterations >= max_iterations){
+ break;
+ }
+ }
if (!FOUND) {
g_print ("No type found\n");
return 1;