Bug 330154 - Knotify notifications playing twice or even three times on a row
Summary: Knotify notifications playing twice or even three times on a row
Status: RESOLVED FIXED
Alias: None
Product: phonon-backend-vlc
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 0.7.1
Platform: unspecified Linux
: NOR normal
Target Milestone: 0.8
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-19 11:59 UTC by Leszek Lesner
Modified: 2014-01-20 08:46 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.7.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leszek Lesner 2014-01-19 11:59:11 UTC
When setting a custom sound file like the one here:
https://www.dropbox.com/s/x0ffb91rq0zef2c/warning.ogg

For KDE Workspace warning and then trying to produce a warning by creating a read only text file and trying to write to it with kate produces the warning sound at least twice. 

Reproducible: Always

Steps to Reproduce:
1. Set a custom warning sound
2. Create a read only text file
3. Try writing to the text file to create a warning sound notification
Actual Results:  
The notification sound for warning is at least played twice. 

Expected Results:  
The notification sound for warning should be played only once.

I also tried that with other sounds and it happens there too. 
I also got an kopete notification sound for logging in user played in a loop again and again until I triggered another notification sound for it to stop. 

I tried different sound files with different formats (ogg and mp3) aswell as short and longer sound files and couldn't find a file specific issue here. Interstingly enough the normal (default) warning sound plays fine. 

The same setup worked fine before with version 0.6.x of phonon-backend-vlc and works fine with phonon-backend-gstreamer. 
Also setting the notification sound player to cvlc in systemsettings works and plays the sound only once.
Comment 1 Leszek Lesner 2014-01-19 12:09:21 UTC
Just an additional thing. phonon-backend-vlc is compiled against libvlc 2.1.x
Comment 2 Leszek Lesner 2014-01-19 17:20:24 UTC
Another addition. Tested that on openSUSE aswell as Debian and Ubuntu all with the same result.
Comment 3 Harald Sitter 2014-01-20 08:46:49 UTC
Git commit 170e55291d18f82612a4f429e4a75ee91c30696e by Harald Sitter.
Committed on 20/01/2014 at 08:46.
Pushed by sitter into branch '0.7'.

Prevent implicit play calls when having queued an invalid source

Some applications (knotify4) queue an intentionally bogus source as
last source to ensure that we terminate playback. This had the opposite
effect since we un-broke queuing as now we'd do a bogus call for play()
after not having changed the source. This was causing a chance
(somewhat timing dependent) to get duplicated sounds at the end of
playback.

moveToNextSource now checks whether m_nextSource actually is valid and
only if it calls play().

(in the long run it may be worthwhile to consider having setSource return
 a bool, to only call play() iff setSource actually was able to do stuff)
FIXED-IN: 0.7.2

M  +9    -1    src/mediaobject.cpp

http://commits.kde.org/phonon-vlc/170e55291d18f82612a4f429e4a75ee91c30696e