问题描述
我正在使用 TagLib
从我使用 wxWidgets 制作的应用程序的音频文件中获取标签。我已将其设置为获取多个标签,如艺术家、标题、专辑等,有些文件加载正常,但有些文件在加载时会崩溃我的应用程序并给出错误提示,
./build.sh: line 12: 5891 Segmentation fault ./Sample@R_404_6437@wser
我尝试用 GDB
跑步,
Thread 1 "Sample@R_404_6437@wser" received signal SIGSEGV,Segmentation fault.
@R_404_6437@wser::AddSamples (this=0x555555a73e00,file=...) at ../src/@R_404[email protected]:248
248 std::string Artist = File.tag()->artist().to8Bit(true);
(gdb)
void @R_404_6437@wser::AddSamples(wxString file)
{
TagLib::FileRef File (file);
std::string Artist = File.tag()->artist().to8Bit(true);
std::string Album = File.tag()->album().to8Bit(true);
std::string Genre = File.tag()->genre().to8Bit(true);
std::string Title = File.tag()->title().to8Bit(true);
std::string Comment = File.tag()->comment().to8Bit(true);
std::string Path = file.ToStdString();
std::string Filename = file.AfterLast('/').BeforeLast('.').ToStdString();
int Bitrate = File.audioProperties()->bitrate();
int Channels = File.audioProperties()->channels();
int Length = File.audioProperties()->lengthInMilliseconds();
int LengthSec = File.audioProperties()->lengthInSeconds();
int SampleRate = File.audioProperties()->sampleRate();
Data.clear();
Data.push_back(false);
Data.push_back(Filename);
Data.push_back(Artist);
Data.push_back(wxString::Format("%d",Channels));
Data.push_back(wxString::Format("%d",Length));
Data.push_back(wxString::Format("%d",SampleRate));
Data.push_back(wxString::Format("%d",Bitrate));
Data.push_back(Comment);
SampleListView->AppendItem(Data);
db.InsertSample(0,Filename,Artist,Channels,Length,SampleRate,Bitrate,Comment,Path);
}
如果需要,我可以提供更多信息。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)