2013-02-05 73 views
1

在聲子庫最近的軟件更新後,我注意到我編寫的媒體播放應用程序不再能夠循環軌道。有問題的代碼在下面。第一首曲目已設置,一旦接近完成,它將被設置爲再次播放。在聲子中入隊不再工作

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); 
    } 
} 

通過調試運行後幾次我注意到這條消息:

"Ignoring source as no aboutToFinish handling is in progress" 

快速谷歌搜索並沒有告訴很多關於此消息。它看起來像一個私人變量檢查(我沒有訪問)已被添加(a diff of the file

有沒有人知道,如果我剛剛發現聲子中的新bug,或者我是一些如何使用enqueue方法不正確?

編輯: 上面的代碼只失敗了大約1/2時間。很困惑。目前運行的聲子的GStreamer 4.6.3

回答

1

這種變通解決:

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(); 
} 
+0

如果使用這一點,有一個黑色的斜線切換視頻時(無無縫播放) – aviit