首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Direct Show 9 phonon "Pins cannot connect“(直接显示9语音错误”Pins cannot connect“)

Direct Show 9 phonon "Pins cannot connect“(直接显示9语音错误”Pins cannot connect“)
EN

Stack Overflow用户
提问于 2012-05-12 09:31:20
回答 1查看 1.4K关注 0票数 2

当我尝试在qt的phonon框架中使用Direct Show 9后端时,我得到了以下错误:

代码语言:javascript
复制
Pins cannot connect due to not supporting the same transport. (0x80040266)

有人知道这个错误的含义和/或如何修复它吗?这是电话的Direct Show 9后端的问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-05-21 03:41:59

显然,这个问题与糟糕的元数据有关。如果Id3标签不是恰到好处,direct show 9后端就会在它们上面卡住。我通过编写以下函数解决了这个问题:

代码语言:javascript
复制
void removeTags(UDJ::DataStore::song_info_t& song){
  static int fileCount =0;
  if(song.source.fileName().endsWith(".mp3")){
    UDJ::Logger::instance()->log("On windows and got mp3, copying and striping metadata tags");
    QString tempCopy = QDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/striped" + QString::number(fileCount) +".mp3";
    if(QFile::exists(tempCopy)){
      UDJ::Logger::instance()->log("Prevoius file existed, deleting now");
      if(QFile::remove(tempCopy)){
        UDJ::Logger::instance()->log("File removal worked");
      }
    }
    bool fileCopyWorked = QFile::copy(song.source.fileName(), tempCopy);
    if(!fileCopyWorked){
      UDJ::Logger::instance()->log("File copy didn't work");
      return;
    }

    TagLib::MPEG::File file(tempCopy.toStdString().c_str()); 
    file.strip();
    file.save();
    Phonon::MediaSource newSource(tempCopy);
    song.source = newSource;
    if(fileCount == 3){
      fileCount =0;
    }
    else{
      fileCount++;
    }
  }
}

song_info_t只是一个带有一个名为source的Phonon::MediaSource成员的结构。该函数的工作方式是使用taglib剥离歌曲的所有元数据,并将新歌曲保存为临时文件。该函数还轮换临时文件所使用的文件名,这样它就不会创建无限数量的临时副本文件。我希望这对其他有这个错误的人有所帮助。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10560349

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档