X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=inline;f=libs%2Fardour%2Faudiofile_tagger.cc;h=e2d81176e115dc87e0527efc7d9c538dab2e4039;hb=5f2ee3328f70c8acca6948abe8a40096d2cb497a;hp=d27b9c97af0364e0a783c3c9d762a486388f963c;hpb=2732c64c07f20aaafcee0e9264f7d5279fbd5708;p=ardour.git diff --git a/libs/ardour/audiofile_tagger.cc b/libs/ardour/audiofile_tagger.cc index d27b9c97af..e2d81176e1 100644 --- a/libs/ardour/audiofile_tagger.cc +++ b/libs/ardour/audiofile_tagger.cc @@ -24,12 +24,12 @@ #include "pbd/convert.h" -#include "taglib/taglib/fileref.h" -#include "taglib/flac/flacfile.h" -#include "taglib/ogg/oggfile.h" -#include "taglib/tag.h" -#include "taglib/toolkit/taglib.h" -#include "taglib/ogg/xiphcomment.h" +#include +#include +#include +#include +#include +#include /* Convert string to TagLib::String */ #define TL_STR(string) TagLib::String ((string).c_str(), TagLib::String::UTF8) @@ -43,6 +43,16 @@ bool AudiofileTagger::tag_file (std::string const & filename, SessionMetadata const & metadata) { TagLib::FileRef file (filename.c_str()); + if (file.isNull()) { + std::cerr << "TagLib::FileRef is null for file" << filename << std::endl; + return true; // continue anyway?! + } + + if (!file.tag()) { + std::cerr << "TagLib::Tag is null for file" << filename << std::endl; + return true; // continue anyway?! + } + TagLib::Tag & tag (*file.tag()); tag_generic (tag, metadata);