Question

After a recent software update to the phonon libraries, I've noticed that a media playing application that I wrote is no longer able to loop tracks. The code in question is below. The first track is set, and once it nears completion it is set to play again.

void Alarm::Start(bool useCustom)
{
    if(useCustom)
    {
        media->setCurrentSource(Phonon::MediaSource(this->_CustPath));
        this->_UsingCustomPath=true;
    }else{
     FileIO::ExtractAudio();
     media->setCurrentSource(Phonon::MediaSource(this->_DefaultPath));
     this->_UsingCustomPath=false;
    }

    media->play();
    connect(media,SIGNAL(aboutToFinish()),this,SLOT(RepeatAllTheThings()));
    this->_isPlaying=true;
}

void Alarm::RepeatAllTheThings()
{
    if(this->_UsingCustomPath)
    {
       media->enqueue(this->_CustPath);
    }else{
        media->enqueue(this->_DefaultPath);
    }
}

After running through the debugger a few times I noticed this message:

"Ignoring source as no aboutToFinish handling is in progress"

A quick google search doesn't tell much about this message. It looks like a check for a private variable (that I dont have access to) has been added (a diff of the file)

Does anyone know if I just discovered a new bug in phonon, or am I some how using the enqueue method incorrectly?

EDIT: The code above only fails about 1/2 the time. Very confused. Currently running phonon-gstreamer 4.6.3

Was it helpful?

Solution

Solved with this work-around:

media->play();
connect(media,SIGNAL(finished()),this,SLOT(RepeatAllTheThings()));



void Alarm::RepeatAllTheThings()
{
    if(this->_UsingCustomPath)
    {
        media->setCurrentSource(Phonon::MediaSource(this->_CustPath));
    }else{
        media->setCurrentSource(Phonon::MediaSource(this->_DefaultPath));
    }
    media->play();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top