Merge lp:~osomon/elisa/gnome_screensaver_fixes into lp:elisa

Proposed by Olivier Tilloy
Status: Needs review
Proposed branch: lp:~osomon/elisa/gnome_screensaver_fixes
Merge into: lp:elisa
Diff against target: 36 lines (+10/-7)
1 file modified
elisa-plugins/elisa/plugins/gnome/gnome_screensaver_service.py (+10/-7)
To merge this branch: bzr merge lp:~osomon/elisa/gnome_screensaver_fixes
Reviewer Review Type Date Requested Status
Elisa Developers code functional Pending
Review via email: mp+25331@code.launchpad.net

Description of the change

This branch (originally submitted for merge against moovida) fixes bug #322719.

The issue was twofold:

1) A wrong assumption that a "status change" message and a "playback ended" message could not be received in a row. Adding a check fixes that.

2) A badly written condition to check whether to (un)inhibit which leaded in successive changes in the inhibition state when seeking in a file.

The careful reviewer will verify that the bug is fixed and that it doesn't introduce any regressions. Music and video playback as well as picture slideshow should be tested. In order to monitor (un)inhibition orders, one can run moovida with ELISA_DEBUG=gnome_screensaver_service:5

To post a comment you must log in.
Revision history for this message
Paul van Tilburg (paulvt) wrote :

I have not reviewed the code, but merged the branch and tested it out when Moovida was idle, playing video, music, pictures. It seems to be fixed!

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the functional review Paul.
Code review, anyone?

Unmerged revisions

1618. By Olivier Tilloy

Do not try to un-inhibit if already un-inhibited. D'oh!

1617. By Olivier Tilloy

Do not try to un-inhibit twice.

1616. By Olivier Tilloy

More debug info.

1615. By Olivier Tilloy

Explicit is better than implicit.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'elisa-plugins/elisa/plugins/gnome/gnome_screensaver_service.py'
2--- elisa-plugins/elisa/plugins/gnome/gnome_screensaver_service.py 2009-11-09 15:44:51 +0000
3+++ elisa-plugins/elisa/plugins/gnome/gnome_screensaver_service.py 2010-05-14 14:39:29 +0000
4@@ -106,9 +106,9 @@
5
6 def cleaned(r):
7 common.application.bus.unregister(self._components_loaded)
8- if self._pm_cookie:
9- d = self._un_inhibit()
10- return d
11+ if self._pm_cookie is not None:
12+ return self._un_inhibit()
13+
14 dfr.addCallback(cleaned)
15 return dfr
16
17@@ -153,12 +153,15 @@
18 self.debug("connected to players")
19
20 def _playback_ended(self, player):
21+ self.debug('%s ended playback' % player)
22 # just unInhibit
23- self._un_inhibit()
24+ if self._pm_cookie is not None:
25+ self._un_inhibit()
26
27 def _player_status_cb(self, player, status):
28 self.debug("%s changed state to %s" % (player, status))
29- if status == player.PLAYING and not self._pm_cookie:
30- self._inhibit('playing media')
31- elif self._pm_cookie:
32+ if status == player.PLAYING:
33+ if self._pm_cookie is None:
34+ self._inhibit('playing media')
35+ elif self._pm_cookie is not None:
36 self._un_inhibit()

Subscribers

People subscribed via source and target branches