Switched from sync transcoder to async transcoder

This commit is contained in:
emeric
2020-12-12 14:43:33 +01:00
parent 0586e93655
commit eea27b86f0
34 changed files with 959 additions and 504 deletions
+4 -5
View File
@@ -19,7 +19,7 @@
#include "CoverArtGrabber.hpp"
#include "av/AvInfo.hpp"
#include "av/IAudioFile.hpp"
#include "database/Release.hpp"
#include "database/Session.hpp"
@@ -125,7 +125,7 @@ Grabber::Grabber(const std::filesystem::path& execPath,
}
std::unique_ptr<IEncodedImage>
Grabber::getFromAvMediaFile(const Av::MediaFile& input, ImageSize width) const
Grabber::getFromAvMediaFile(const Av::IAudioFile& input, ImageSize width) const
{
std::unique_ptr<IEncodedImage> image;
@@ -303,10 +303,9 @@ Grabber::getFromTrack(const std::filesystem::path& p, ImageSize width) const
try
{
const Av::MediaFile input {p};
image = getFromAvMediaFile(input, width);
image = getFromAvMediaFile(*Av::parseAudioFile(p), width);
}
catch (Av::AvException& e)
catch (Av::Exception& e)
{
LMS_LOG(COVER, ERROR) << "Cannot get covers from track " << p.string() << ": " << e.what();
}