trying to fix start video after long pause
authorVlad <vlad@gas.by>
Wed, 4 Aug 2010 14:14:51 +0000 (17:14 +0300)
committerVlad <vlad@gas.by>
Wed, 4 Aug 2010 14:14:51 +0000 (17:14 +0300)
applet/src/livewp-scene.c

index 73aac03..dca13f0 100644 (file)
@@ -55,7 +55,7 @@ destroy_scene(AWallpaperPlugin *desktop_plugin)
 void
 reload_scene(AWallpaperPlugin *desktop_plugin)
 {
-    fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);  
+    /* fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme); */
     destroy_scene(desktop_plugin);
     init_scene_theme(desktop_plugin);
 }
@@ -71,7 +71,7 @@ init_scene_Accel(AWallpaperPlugin *desktop_plugin)
     gint sizes1[4] = {57, 76, 43, 50},
          n, j;
     
-    fprintf(stderr, "init scene accel\n");
+    /* fprintf(stderr, "init scene accel\n"); */
     scene = g_new0(Scene, 1);
     scene->actors = NULL;
     desktop_plugin->priv->scene = scene;
@@ -85,16 +85,16 @@ init_scene_Accel(AWallpaperPlugin *desktop_plugin)
     child = g_ptr_array_sized_new(16);
     
     for (j= 0; j<4; j++){
-    for (n=0; n<4; n++){
-        str = g_strdup_printf("tape%i.png", n+1);
-        actor = init_object(desktop_plugin, "tape", str,
-                            fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
-                            TRUE, TRUE, 100, 255,
-                            NULL, NULL, NULL);
-        scene->actors = g_slist_append(scene->actors, actor);
-        g_ptr_array_add(child, actor);
-        g_free(str);
-    }
+        for (n=0; n<4; n++){
+            str = g_strdup_printf("tape%i.png", n+1);
+            actor = init_object(desktop_plugin, "tape", str,
+                                fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
+                                TRUE, TRUE, 100, 255,
+                                NULL, NULL, NULL);
+            scene->actors = g_slist_append(scene->actors, actor);
+            g_ptr_array_add(child, actor);
+            g_free(str);
+        }
     }
     actor = init_object(desktop_plugin, "tape", "", 
                       0, 800, 5, 800, 170, 
@@ -247,8 +247,8 @@ init_scene_Video(AWallpaperPlugin *desktop_plugin)
            gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
 
     if (desktop_plugin->priv->visible){
-        gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
         g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin); 
+        gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
     }
    
     //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);