@@ -340,7 +340,7 @@ size_t VideoProperties::getBitRate() const
340
340
avcodec_open2 (_codecContext, _codec, NULL );
341
341
342
342
int gotFrame = 0 ;
343
- int count = 0 ;
343
+ size_t count = 0 ;
344
344
int gopFramesSize = 0 ;
345
345
346
346
while (!av_read_frame (const_cast <AVFormatContext*>(_formatContext), &pkt))
@@ -359,12 +359,12 @@ size_t VideoProperties::getBitRate() const
359
359
}
360
360
}
361
361
av_free_packet (&pkt);
362
- if (_codecContext-> gop_size == count)
362
+ if (getGopSize () == count)
363
363
break ;
364
364
}
365
365
366
366
int bitsPerByte = 8 ;
367
- return (gopFramesSize / _codecContext-> gop_size ) * bitsPerByte * getFps ();
367
+ return (gopFramesSize / getGopSize () ) * bitsPerByte * getFps ();
368
368
}
369
369
370
370
size_t VideoProperties::getMaxBitRate () const
@@ -484,7 +484,7 @@ void VideoProperties::analyseGopStructure(IProgress& progress)
484
484
avcodec_open2 (_codecContext, _codec, NULL );
485
485
486
486
Frame frame;
487
- int count = 0 ;
487
+ size_t count = 0 ;
488
488
int gotFrame = 0 ;
489
489
bool stopAnalyse = false ;
490
490
@@ -501,14 +501,14 @@ void VideoProperties::analyseGopStructure(IProgress& progress)
501
501
_isInterlaced = avFrame.interlaced_frame ;
502
502
_isTopFieldFirst = avFrame.top_field_first ;
503
503
++count;
504
- if (progress.progress (count, _codecContext-> gop_size ) == eJobStatusCancel)
504
+ if (progress.progress (count, getGopSize () ) == eJobStatusCancel)
505
505
stopAnalyse = true ;
506
506
}
507
507
}
508
508
509
509
av_free_packet (&pkt);
510
510
511
- if (_codecContext-> gop_size == count)
511
+ if (getGopSize () == count)
512
512
{
513
513
stopAnalyse = true ;
514
514
}
0 commit comments