mini6410中我用qt嵌入mplayer作音频播放器,发现用qprocess启动mplayer根本就无法启动
相反如果用system等函数是可以顺利启动并播放歌曲的?请问这是什么问题?
以下是我的代码:
include <QProcess>
| 2
- test.cpp (/Git/ARICE/demo/Q| 3 int main(int argc, char *argv[])
|- function | 4 {
|| main | 5 QProcess *process = new QProcess();
| 6 QStringList args;
~ | 7 QString exefile = "/bin/mplayer";
~ | 8 QString fileName = "/usr/local/shi.mp3";
~ | 9 args << " -slave";
~ | 10 args << " -quiet";
~ | 11 args << fileName;
~ | 12 process->setProcessChannelMode(QProcess::MergedChannels);
~ | 13 process->start(exefile, args);
~ | 14 if(!process->waitForFinished(3000)) {
~ | 15
~ | 16 }
~ | 17 }