carlonluca / pot

Raspberry Pi accelerated video/image rendering with Qt: custom QML components and QtMultimedia backend.
https://bugfreeblog.duckdns.org
GNU General Public License v2.0
177 stars 42 forks source link

[POT 5.6 RC1] MediaPlayer autoPlay property keeps playing last source #59

Open sinadogru opened 8 years ago

sinadogru commented 8 years ago

To mimic the bug, please try a MediaPlayer with a mp3 (I am not sure if this bug is related with mp3's.).

MediaPlayer {
        id: player
        autoPlay: true
        loops: 1
        source: "file:///home/pi/sin.mp3"
        onStopped: {
            source = "";
        }
}

Even loops property setted to 1, on stopped handler, assigning source to empty string does not cause to MediaPlayer stops. What I mean it keeps going to play last source, "sin.mp3".

After few tries to find out where is the exact problem is, I guess I detected it because of the autoPlay property is setted to true. To prove it is because of autoPlay property please try this, and you should see that MediaPlayer does not keep going to play last source:

MediaPlayer {
        id: player
        autoPlay: true
        loops: 1
        source: "file:///home/pi/sin.mp3"
        onStopped: {
            autoPlay = false;
            source = "";
        }
}

I have not check the codes but somehow setting the autoPlay to true cause the MediaPlayer keeps playing the source property even it is setted to empty string.