Skip to content

Commit

Permalink
Better time analysis while generating bif
Browse files Browse the repository at this point in the history
  • Loading branch information
towel42-com committed Nov 15, 2022
1 parent 02dbf9b commit 36cc750
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion UI/BIFViewerPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ namespace NMediaManager
new QTreeWidgetItem( fImpl->bifFileValues, QStringList() << tr( "Magic Number" ) << tr( "00-07" ) << QString() << fBIF->magicNumber() );
new QTreeWidgetItem( fImpl->bifFileValues, QStringList() << tr( "Version" ) << tr( "08-11" ) << QString::number( fBIF->version().fValue ) << fBIF->version().fPrettyPrint );
new QTreeWidgetItem( fImpl->bifFileValues, QStringList() << tr( "Number of BIF Images" ) << tr( "12-15" ) << QString::number( fBIF->numImages().fValue ) << fBIF->numImages().fPrettyPrint );
new QTreeWidgetItem( fImpl->bifFileValues, QStringList() << tr( "milliseconds/Frame" ) << tr( "16-19" ) << QString( "%1s (%2ms)" ).arg( NSABUtils::CTimeString( fBIF->tsMultiplier().fValue ).toString( "ss.zzz" ) ).arg( fBIF->tsMultiplier().fValue ) << fBIF->tsMultiplier().fPrettyPrint );
new QTreeWidgetItem( fImpl->bifFileValues, QStringList() << tr( "milliseconds/Frame" ) << tr( "16-19" ) << QString( "%1s (%2ms)" ).arg( NSABUtils::CTimeString( fBIF->timePerFrame().fValue ).toString( "ss.zzz" ) ).arg( fBIF->timePerFrame().fValue ) << fBIF->timePerFrame().fPrettyPrint );
new QTreeWidgetItem( fImpl->bifFileValues, QStringList() << tr( "Reserved" ) << tr( "20-64" ) << QString() << fBIF->reserved() );

formatBIFTable();
Expand Down
6 changes: 4 additions & 2 deletions UI/GenerateBIFPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace NMediaManager
{
// Skip-Option - Write output: pkt_pts_time:2570 pkt_dts_time:2570 input_pts_time:2570.2
// time=00:00:00.00
auto regEx = QRegularExpression( R"(pkt_pts_[Tt]ime\:(?<secs>\d+))" );
auto regEx = QRegularExpression( R"((input_pts_[Tt]ime\:(?<secs1>\d+))|(pkt_pts_[Tt]ime\:(?<secs2>\d+)))" );
auto pos = string.lastIndexOf( regEx );
if ( pos == -1 )
return;
Expand All @@ -94,7 +94,9 @@ namespace NMediaManager
if ( !match.hasMatch() )
return;

auto secs = match.captured( "secs" );
auto secs = match.captured( "secs1" );
if ( secs.isEmpty() )
secs = match.captured( "secs2" );
int numSeconds = 0;
if ( !secs.isEmpty() )
{
Expand Down

0 comments on commit 36cc750

Please sign in to comment.