BogdanovKirill / RtspClientSharp

Pure C# RTSP client for .NET Standard without external dependencies and with true async nature. I welcome contributions.
MIT License
706 stars 284 forks source link

H264Parser - ProcessNalUnit generateFrame parameter always false #43

Closed Dimigergo closed 5 years ago

Dimigergo commented 5 years ago

Hello!

In the ProcessNalUnit method the last parameter (generateFrame) is always false. In this case the following condition is always false in H264Parser.cs - line 143: if (generateFrame && _frameStream.Position == 0) TryGenerateFrame(byteSegment, mediaId);

Is it a bug, or it is an old code?

Thanks in advance!

BogdanovKirill commented 5 years ago

Why do you think that it's a bug? It depends on rtsp source. It seems that in your case it is false, but it doesn't mean that it will be false in general

Dimigergo commented 5 years ago

Ok, but the there are 2 method calls: H264Parser.cs - line 107 ProcessNalUnit(mediaId, byteSegment, true, false); H264Parser.cs - line 50 ProcessNalUnit(byteSegment, false, false);

Both of them are hard-coded false.

BogdanovKirill commented 5 years ago

Thank you for your report. You are right. Should be fixed now.