Factorized some container/codec handling code + removed the no longer needed transcode output formats mka and webm

This commit is contained in:
emeric
2025-11-30 18:48:04 +01:00
parent c3cd30f248
commit d834f34683
65 changed files with 1424 additions and 1003 deletions
@@ -19,11 +19,7 @@
#include "TranscodeService.hpp"
#include "audio/ITranscoder.hpp"
#include "core/ILogger.hpp"
#include "core/UUID.hpp"
#include "database/IDb.hpp"
#include "database/Session.hpp"
#include "TranscodeResourceHandler.hpp"
@@ -61,10 +57,10 @@ namespace lms::transcoding
if (estimateContentLength)
{
if (parameters.inputParameters.offset < parameters.inputParameters.duration)
estimatedContentLength = doEstimateContentLength(*parameters.outputParameters.bitrate, parameters.inputParameters.duration - parameters.inputParameters.offset);
if (parameters.inputParameters.offset < parameters.inputParameters.audioProperties.duration)
estimatedContentLength = doEstimateContentLength(*parameters.outputParameters.bitrate, parameters.inputParameters.audioProperties.duration - parameters.inputParameters.offset);
else
LMS_LOG(TRANSCODING, WARNING, "Offset " << parameters.inputParameters.offset << " is greater than audio file duration " << parameters.inputParameters.duration << ": not estimating content length");
LMS_LOG(TRANSCODING, WARNING, "Offset " << parameters.inputParameters.offset << " is greater than audio file duration " << parameters.inputParameters.audioProperties.duration << ": not estimating content length");
}
return std::make_unique<transcoding::ResourceHandler>(parameters, estimatedContentLength);