Open
Description
In MpegStreamReader constructor the first MpegFrame found in the file gets thrown away.
`
// find the first Mpeg frame
var frame = FindNextFrame();
while (frame != null && !(frame is MpegFrame))
{
frame = FindNextFrame();
}
// if we still don't have a frame, we never sync'ed
if (frame == null) throw new InvalidDataException("Not a valid MPEG file!");
// the very next frame "should be" an mpeg frame
frame = FindNextFrame();
`
If the next frame isn't an MpegFrame then the entire decode fails.
At the point before the comment 'the very next frame "should be" an mpeg frame', frame already refers to an MpegFrame so there is no need to read the following one.
This causes me a problem because I am decoding a stream that only contains a single MpegFrame at a time.
Metadata
Assignees
Labels
No labels
Activity