[xiph-commits] r3080 - liboggplay/trunk/plugin

shans at svn.annodex.net shans at svn.annodex.net
Tue Jun 26 21:18:17 PDT 2007


Author: shans
Date: 2007-06-26 21:18:17 -0700 (Tue, 26 Jun 2007)
New Revision: 3080

Modified:
   liboggplay/trunk/plugin/plugin_gui_linux.c
Log:
Factored out rendering function



Modified: liboggplay/trunk/plugin/plugin_gui_linux.c
===================================================================
--- liboggplay/trunk/plugin/plugin_gui_linux.c	2007-06-27 04:10:29 UTC (rev 3079)
+++ liboggplay/trunk/plugin/plugin_gui_linux.c	2007-06-27 04:18:17 UTC (rev 3080)
@@ -124,9 +124,24 @@
   return FALSE;
 }
 
+void
+render_frame_to_screen(PluginWindowInfo * info, PluginOggFrame *frame_data) {
+  Imlib_Image image;
+
+  convert_oggplay_frame(info->ogg_handle, frame_data, BGR);
+  image = imlib_create_image_using_data(frame_data->width, 
+                    frame_data->height, (unsigned int *)frame_data->frame);
+  imlib_context_set_image(image);
+  imlib_render_image_on_drawable_at_size(0, 0, info->width, info->height);
+  imlib_free_image_and_decache();
+}
+
+
 #define OGGPLAY_FRAME_SKIP_OFFSET -30
 #define OGGPLAY_MIN_OFFSET        2
 
+
+
 gboolean
 update_frame(gpointer _info) {
 
@@ -154,14 +169,7 @@
 
   get_oggplay_frame(info->ogg_handle, &frame_data);
   if (frame_data.video_data != NULL) {    
-    Imlib_Image image;
-
-    convert_oggplay_frame(info->ogg_handle, &frame_data, BGR);
-    image = imlib_create_image_using_data(frame_data.width, 
-                    frame_data.height, (unsigned int *)frame_data.frame);
-    imlib_context_set_image(image);
-    imlib_render_image_on_drawable_at_size(0, 0, info->width, info->height);
-    imlib_free_image_and_decache();
+    render_frame_to_screen(info, &frame_data);
   } else if (frame_data.samples == NULL) {
     return TRUE;
   }



More information about the commits mailing list