문제

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

도움이 되었습니까?

해결책

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();
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top