View Single Post
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#21
Relevant parts from the N800 port (ripped from the diff) to do this:

Code:
mplayer-1.0rc1/mplayer.c:
+#ifdef HAVE_MAEMO
+#include <libosso.h>
+
+extern int vo_null_active;
+
+// display blanking prevention for Nokia 770/N800
+void *maemo_screensaver_heartbeat()
+{
+    static unsigned int time_last;
+    static osso_context_t *ossocontext = NULL;
+    
+    if (vo_null_active) return;
+    
+    unsigned int time = GetTimerMS();
+    
+    if (!ossocontext) {
+        ossocontext = osso_initialize("mplayer-cli", VERSION, 0, NULL);
+        time_last = time;
+        osso_display_state_on(ossocontext);
+        osso_display_blanking_pause(ossocontext);
+    }
+    
+    if ((time - time_last) > 55000)
+    {
+        time_last = time;
+        osso_display_state_on(ossocontext);
+        osso_display_blanking_pause(ossocontext);
+    } else if ((time - time_last) > 50000) {
+        time_last = time;
+        osso_display_blanking_pause(ossocontext);
+    }
+}
+#endif
+
+#ifdef HAVE_MAEMO
+if (sh_video) {
+  current_module="stop_maemo_screensaver";
+  maemo_screensaver_heartbeat();
+  current_module=NULL;
+}
+#endif
+
   // DVD sub:
 if(vo_config_count && vo_spudec) {
The functions used are still the same in Fremantle (I have osso_display_blanking_pause() attached to a GSourceFunc function and it still works in Transmission running on Fremantle to stop the display from being blanked).
 

The Following 14 Users Say Thank You to qwerty12 For This Useful Post: