Skip to content

Commit

Permalink
fix: initial position not zero when first PTS not zero
Browse files Browse the repository at this point in the history
  • Loading branch information
protyposis committed Jan 30, 2024
1 parent 18ca358 commit 8867464
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Aurio.FFmpeg.UnitTest/FFmpegSourceStreamTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,14 @@ public void TS_NonZeroStartTime_SeekingSupported()

Assert.Equal(1000, s.Position);
}

[Fact]
public void NonZeroStartTime_InitialPositionIsZero()
{
var fileInfo = new FileInfo("./Resources/sine440-44100-16-mono-200ms.ts");
var s = new FFmpegSourceStream(fileInfo);

Assert.Equal(0, s.Position);
}
}
}
1 change: 0 additions & 1 deletion src/Aurio.FFmpeg/FFmpegSourceStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ private void DetermineFirstPts()
catch (InvalidOperationException)
{
readerFirstPTS = readerPosition;
readerPosition = 0;
Console.WriteLine("first PTS = " + readerFirstPTS);
}
}
Expand Down

0 comments on commit 8867464

Please sign in to comment.