rem: }
add: } while (pixbuf == NULL && i < 20);
context: int main (int argc, char *argv[]){	GError *err = NULL;	BaconVideoWidget *bvw;	GdkPixbuf *pixbuf;	int i, length, size;	char *input, *output;	if (argc <= 2 || strcmp (argv[1], "-h") == 0 ||	    strcmp (argv[1], "--help") == 0) {		g_print ("Usage: %s [-s <size>] <input> <output> [backend options]\n", argv[0]);		return -1;	}	nice (20);	g_thread_init (NULL);#ifndef THUMB_DEBUG	g_type_init ();#else	gtk_init (&argc, &argv);#endif	bacon_video_widget_init_backend (&argc, &argv);	if (!strcmp (argv[1], "-s")) {		input = argv[3];		output = argv[4];		size = g_strtod (argv[2], NULL);	} else {		input = argv[1];		output = argv[2];		size = 128;	}	bvw = BACON_VIDEO_WIDGET (bacon_video_widget_new (-1, -1, BVW_USE_TYPE_CAPTURE, &err));	if (err != NULL)	{		g_print ("totem-video-thumbnailer couln't create the video "				"widget.\nReason: %s.\n", err->message);		g_error_free (err);		exit (1);	}	g_thread_create (time_monitor, (gpointer) input, FALSE, NULL);	if (bacon_video_widget_open (bvw, input, &err) == FALSE)	{		if (err->code == BVW_ERROR_STILL_IMAGE)		{			g_error_free (err);			err = NULL;			pixbuf = gdk_pixbuf_new_from_file (input, &err);			if (pixbuf != NULL)			{				save_still_pixbuf (pixbuf,						output, input, size);				gdk_pixbuf_unref (pixbuf);				exit (0);			}			g_print ("totem-video-thumbnailer couln't open file '%s'\n"					"Reason: %s.\n", input, err->message);			g_error_free (err);			exit (1);		}		g_print ("totem-video-thumbnailer couln't open file '%s'\n"				"Reason: %s.\n",				input, err->message);		g_error_free (err);		exit (1);	}	bacon_video_widget_play (bvw, &err);	if (err != NULL)	{		g_print ("totem-video-thumbnailer couln't play file: '%s'\n"				"Reason: %s.\n",				input, err->message);		g_error_free (err);		exit (1);	}	/* A 3rd into the file */	length = bacon_video_widget_get_stream_length (bvw);	if (length > MIN_LEN_FOR_SEEK)	{		if (bacon_video_widget_seek				(bvw, ((float) 1 / 3), NULL) == FALSE)		{			bacon_video_widget_play (bvw, NULL);		}	}	finished = TRUE;	if (bacon_video_widget_can_get_frames (bvw, &err) == FALSE)	{		g_print ("totem-video-thumbnailer: '%s' isn't thumbnailable\n"				"Reason: %s\n",				input, err ? err->message : "programming error");		bacon_video_widget_close (bvw);		gtk_widget_destroy (GTK_WIDGET (bvw));		g_error_free (err);		exit (1);	}	/* 10 seconds! */	i = 0;	pixbuf = bacon_video_widget_get_current_frame (bvw);	while (pixbuf == NULL && i < 20)	{		g_usleep (500000);		pixbuf = bacon_video_widget_get_current_frame (bvw);		i++;	}	/* Cleanup */	bacon_video_widget_close (bvw);	gtk_widget_destroy (GTK_WIDGET (bvw));	if (pixbuf == NULL)	{		g_print ("totem-video-thumbnailer couln't get a picture from "					"'%s'\n", input);		exit (1);	}	save_pixbuf (pixbuf, output, input, size);	gdk_pixbuf_unref (pixbuf);	return 0;}