File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/AvTranscoder/transcoder Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -521,12 +521,13 @@ void Transcoder::fillProcessStat( ProcessStat& processStat )
521
521
for ( size_t streamIndex = 0 ; streamIndex < _streamTranscoders.size (); ++streamIndex )
522
522
{
523
523
IOutputStream& stream = _streamTranscoders.at ( streamIndex )->getOutputStream ();
524
- AVCodecContext& encoderContext = _streamTranscoders.at ( streamIndex )->getEncoder ().getCodec (). getAVCodecContext ();
525
- switch ( encoderContext. codec_type )
524
+ const AVMediaType mediaType = _streamTranscoders.at ( streamIndex )->getInputStream ().getStreamType ();
525
+ switch ( mediaType )
526
526
{
527
527
case AVMEDIA_TYPE_VIDEO:
528
528
{
529
529
VideoStat videoStat ( stream.getStreamDuration (), stream.getNbFrames () );
530
+ const AVCodecContext& encoderContext = _streamTranscoders.at ( streamIndex )->getEncoder ().getCodec ().getAVCodecContext ();
530
531
if ( encoderContext.coded_frame && ( encoderContext.flags & CODEC_FLAG_PSNR) )
531
532
{
532
533
videoStat._quality = encoderContext.coded_frame ->quality ;
@@ -542,7 +543,7 @@ void Transcoder::fillProcessStat( ProcessStat& processStat )
542
543
break ;
543
544
}
544
545
default :
545
- LOG_WARN ( " No process statistics for stream at index: " << streamIndex )
546
+ LOG_WARN ( " No process statistics for stream at index: " << streamIndex << " (AVMediaType = " << mediaType << " ) " )
546
547
break ;
547
548
}
548
549
}
You can’t perform that action at this time.
0 commit comments