[mistelix/stable] Fixes thumbnailing avoing having sometimes a different frame for the same video



commit f14309ccf930d85dff251b8d622a6c14b4ec3232
Author: Jordi Mas <jmas softcatala org>
Date:   Fri Jul 17 16:13:35 2009 +0200

    Fixes thumbnailing avoing having sometimes a different frame for the same video

 libmistelix/thumbnail.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/libmistelix/thumbnail.c b/libmistelix/thumbnail.c
index 767d9a8..8c7287b 100644
--- a/libmistelix/thumbnail.c
+++ b/libmistelix/thumbnail.c
@@ -82,29 +82,20 @@ mistelix_take_screenshot (GstElement* playbin, GstBus* bus, GstElement* pixbufsi
 	gst_element_get_state (playbin, NULL, NULL, 2 * GST_SECOND);
 
 	gboolean bol =  gst_element_seek (playbin, 1.0, 
-		GST_FORMAT_TIME | GST_SEEK_FLAG_ACCURATE,
+		GST_FORMAT_TIME,
 		GST_SEEK_FLAG_FLUSH,
 		GST_SEEK_TYPE_SET, time * GST_SECOND,
 		GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
 
-	gst_element_set_state (GST_ELEMENT (playbin), GST_STATE_PLAYING);
-	gst_element_get_state (playbin, NULL, NULL, 2 * GST_SECOND);
-	
-	/* gdkpixbufsink sends a GST_MESSAGE_ELEMENT when a picture is ready */
 	while (1) {
 		message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 2);
 #ifdef _DEBUG
 		printf ("*** run_pipeline message: %s (%x)\n", gst_message_type_get_name (revent), revent);
 #endif
+
 		if (message) {
 			revent = GST_MESSAGE_TYPE (message);
 			gst_message_unref (message);
-
-			if (revent == GST_MESSAGE_ELEMENT) {
-				printf ("*** run_pipeline: break element\n");
-				break;
-			}
-
 		} else
 			revent = GST_MESSAGE_UNKNOWN;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]