Skip to content

Commit d76c410

Browse files
author
Valentin Noel
committed
Transcoder: use av_q2d to compute progress duration
1 parent d8afcb8 commit d76c410

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,8 @@ void Transcoder::process( IProgress& progress )
316316
if( ! frameProcessed )
317317
break;
318318

319-
int currentDts = _outputFile.getFormatContext().streams[0]->cur_dts;
320-
int timebaseNum = _outputFile.getFormatContext().streams[0]->time_base.num;
321-
int timebaseDen = _outputFile.getFormatContext().streams[0]->time_base.den;
322-
323-
double duration = (double)currentDts * timebaseNum / timebaseDen;
319+
AVStream* firstOutputStream = _outputFile.getFormatContext().streams[0];
320+
double duration = firstOutputStream->cur_dts * av_q2d( firstOutputStream->time_base );
324321

325322
if( progress.progress( duration, totalDuration ) == eJobStatusCancel )
326323
{

0 commit comments

Comments
 (0)