Skip to content

Commit 119731c

Browse files
author
Clement Champetier
committed
Transcoder: check output duration when the process method is based on duration
1 parent fb3c87a commit 119731c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ bool Transcoder::processFrame()
238238
for(size_t streamIndex = 0; streamIndex < _streamTranscoders.size(); ++streamIndex)
239239
{
240240
LOG_DEBUG("Process stream " << streamIndex << "/" << (_streamTranscoders.size() - 1))
241+
242+
// if a stream failed to process
241243
if(!_streamTranscoders.at(streamIndex)->processFrame())
242244
{
243245
LOG_WARN("Failed to process stream " << streamIndex)
@@ -291,6 +293,14 @@ ProcessStat Transcoder::process(IProgress& progress)
291293
LOG_INFO("End of process because the job was canceled.")
292294
break;
293295
}
296+
297+
// check progressDuration
298+
if(_eProcessMethod == eProcessMethodBasedOnDuration && progressDuration >= expectedOutputDuration)
299+
{
300+
LOG_INFO("End of process because the output program duration ("
301+
<< progressDuration << "s) is equal or upper than " << expectedOutputDuration << "s.")
302+
break;
303+
}
294304
}
295305

296306
_outputFile.endWrap();

0 commit comments

Comments
 (0)