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