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

Bugfix: prevent borked generated audio file if meetecho header is sent with no RTP data next #2356

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

SamyCookie
Copy link
Contributor

@SamyCookie SamyCookie commented Sep 9, 2020

For some reason I ignore, Janus server created a MJR file, with MEET..B?.T (4D 45 45 54 00 05 42 D5 00 54) for final data, aka a MEETECHO header with an expected of 84 bytes RTP packet data next. But this RTP packet data has not been written.

Consequences: postprocessing fails to generate a correct audio file, and some random extra silence audio data is badly inserted.

The current patch prevent this behaviour to happen by stopping MJR parsing if no data is reachable next.

Copy link
Member

@lminiero lminiero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Added a couple of notes inline. I see you signed the CLA already, so for me this can be merged as soon as the notes are addressed.

postprocessing/janus-pp-rec.c Outdated Show resolved Hide resolved
@atoppi
Copy link
Member

atoppi commented Sep 9, 2020

Hi @SamyCookie ,
thanks for the contribution!
Can you add the same checks for data frames too?

@SamyCookie
Copy link
Contributor Author

@atoppi done too !

postprocessing/janus-pp-rec.c Outdated Show resolved Hide resolved
postprocessing/janus-pp-rec.c Outdated Show resolved Hide resolved
@atoppi
Copy link
Member

atoppi commented Sep 9, 2020

lgtm 👍

@lminiero
Copy link
Member

lminiero commented Sep 9, 2020

Thanks for the quick fixes, merging then!

@lminiero lminiero merged commit 6ca2169 into meetecho:master Sep 9, 2020
@SamyCookie
Copy link
Contributor Author

@lminiero Should I write a ticket to reference the original problem ? (the fact that the server has written a MEETECHO header with no data next)

@SamyCookie SamyCookie deleted the rtp_packet_data_missing branch September 9, 2020 14:08
@lminiero
Copy link
Member

lminiero commented Sep 9, 2020

I don't think there's any issue to address: it might be that a recording was closed while writing the last packet. As long as the postprocessor deals with it properly I think we're fine. As a side node, Janus doesn't write MEETECHO as a per-packet header anymore, but only MEET, as the other 4 bytes are used to store a partial timestamp of when we received the packet.

@SamyCookie
Copy link
Contributor Author

SamyCookie commented Sep 9, 2020

I don't think there's any issue to address: it might be that a recording was closed while writing the last packet. As long as the postprocessor deals with it properly I think we're fine.

OK, but IMHO, this behaviour is unconsistant and should be fixed server side one day.

As a side node, Janus doesn't write MEETECHO as a per-packet header anymore, but only MEET, as the other 4 bytes are used to store a partial timestamp of when we received the packet.

You are right and it is a typo from me cause I already saw this in janus-pp-rec. Also, should the last Meetecho Janus Recordings specification here be updated to last version (aka MJR00002) ?

@SamyCookie
Copy link
Contributor Author

And of course, thanks for your time and merging this !

@lminiero
Copy link
Member

lminiero commented Sep 9, 2020

Good catch, I reflected that change in some slides recently (e.g., see slides 49-50 here, but forgot to update the docs. I'll do that shortly.

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

Successfully merging this pull request may close these issues.

None yet

3 participants