Skip to content

Commit

Permalink
finalPts and finalDur should not be updated on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dcarpente committed Aug 11, 2017
1 parent dbe4b0c commit 86a516a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions FFmpegInterop/Source/UncompressedAudioSampleProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,14 @@ MediaStreamSample^ UncompressedAudioSampleProvider::GetNextSample()

hr = GetNextPacket(dataWriter, pts, dur);

if (finalPts == -1)
if (SUCCEEDED(hr))
{
finalPts = pts;
if (finalPts == -1)
{
finalPts = pts;
}
finalDur += dur;
}
finalDur += dur;

} while (SUCCEEDED(hr) && finalDur < MINAUDIOSAMPLEDURATION);

Expand Down

0 comments on commit 86a516a

Please sign in to comment.