Skip to content

Commit 54e966a

Browse files
author
Clement Champetier
committed
StreamTranscoder: fixed end of process in case of offset
1 parent 119731c commit 54e966a

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,8 @@ void StreamTranscoder::preProcessCodecLatency()
355355

356356
bool StreamTranscoder::processFrame()
357357
{
358-
const EProcessCase processCase = getProcessCase();
359358
std::string msg = "Current process case of the stream is a ";
360-
switch(processCase)
359+
switch(getProcessCase())
361360
{
362361
case eProcessCaseTranscode:
363362
msg += "transcode.";
@@ -371,9 +370,6 @@ bool StreamTranscoder::processFrame()
371370
}
372371
LOG_DEBUG(msg)
373372

374-
if(processCase == eProcessCaseGenerator)
375-
return processTranscode();
376-
377373
// Manage offset
378374
if(_offset > 0)
379375
{
@@ -382,7 +378,7 @@ bool StreamTranscoder::processFrame()
382378
{
383379
LOG_INFO("End of positive offset")
384380

385-
if(getProcessCase() == eProcessCaseTranscode)
381+
if(_inputDecoder)
386382
switchToInputDecoder();
387383
else
388384
_currentDecoder = NULL;
@@ -392,9 +388,7 @@ bool StreamTranscoder::processFrame()
392388
{
393389
// process generator
394390
if(_currentDecoder != _generator)
395-
{
396391
switchToGeneratorDecoder();
397-
}
398392
}
399393
}
400394
else if(_offset < 0)
@@ -405,14 +399,14 @@ bool StreamTranscoder::processFrame()
405399
{
406400
LOG_INFO("End of negative offset")
407401

408-
switchToGeneratorDecoder();
402+
if(_needToSwitchToGenerator)
403+
switchToGeneratorDecoder();
409404
_offset = 0;
410405
}
411406
}
412407

413-
if(processCase == eProcessCaseRewrap)
408+
if(getProcessCase() == eProcessCaseRewrap)
414409
return processRewrap();
415-
416410
return processTranscode(_subStreamIndex);
417411
}
418412

0 commit comments

Comments
 (0)