Skip to content

Commit

Permalink
Merge pull request #1215 from CastagnaIT/fix_timebase
Browse files Browse the repository at this point in the history
[FragmentedSampleReader] Ensure m_timeBaseInt is > 0
  • Loading branch information
glennguy authored Apr 8, 2023
2 parents 2c5f03a + 3c7d73f commit 4b6ca27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/samplereader/FragmentedSampleReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ CFragmentedSampleReader::CFragmentedSampleReader(AP4_ByteStream* input,

m_timeBaseExt = STREAM_TIME_BASE;
m_timeBaseInt = m_track->GetMediaTimeScale();
if (m_timeBaseInt == 0)
{
LOG::LogF(LOGWARNING, "Unable to get track media timescale value.");
m_timeBaseInt = 1;
}

// remove unneeded trailing zeroes
while (m_timeBaseExt > 1)
Expand Down

0 comments on commit 4b6ca27

Please sign in to comment.