Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missed order of NALUnit. #2

Open
awen190418 opened this issue May 29, 2020 · 0 comments
Open

Missed order of NALUnit. #2

awen190418 opened this issue May 29, 2020 · 0 comments

Comments

@awen190418
Copy link

At

self.delegate?.didReceiveNALUnit(nalu)

we are releasing Single NAL Unit before releasing the accumulated FU Fragments. Lets consider following example:

Let us consider the following NAL fragments. A integer in the first box means a id and other other box contains the type of NAL Unit. -> refers to the next NALUnit that was received.

| 22 |FU Unit........ | -> | 23 |FU Unit .......... | -> | 24 |FU Unit .......... | -> | 25 | Single NAL Unit .......... | ->| 26 |FU Unit .......... | -> | 27 |FU Unit .......... | ......

In above NALUnit fragments from 22 to 24 will be in a buffer. Then fragment with id 25 arrives but it gets released before releasing the previous NALUnits. I guess this causes some more scratches in the decoded video.

Therefore, How about releasing the previous buffer before releasing the single unit to decoder ?
How about adding

if fragment.isEndUnit{
           didAssembleFU(&fragmentedNALU!)//Send the portion of data that we have collected so far in the past.
           fragmentedNALU = nil
       }

at

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant