Repository navigation
core: add SMBF_LAST media bug flag to keep a bug behind all others - #3
Merged
Merged
Conversation
…ment SMBF_LAST limits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
To record audio reliably, the recording bug has to see each frame after every other bug has changed it. On the write path,
SMBF_WRITE_STREAMandSMBF_WRITE_REPLACEcallbacks run in one loop in list order, so a recorder only sees the written audio as modified by the bugs linked in front of it.SMBF_FIRSTlets a bug go to the front of the list, but nothing lets a bug stay at the end: any bug added later is appended behind it. So once a bug that replaces written frames is added after the recording starts, the recording no longer captures the audio that is actually sent.The read path doesn't have this problem: all
SMBF_READ_REPLACEcallbacks run before anySMBF_READ_STREAMbuffer is filled. There,SMBF_LASTonly orders the replace bugs among themselves.Summary
SMBF_LAST(1 << 28). A bug added with this flag goes to the end of the list. Bugs added after it, without the flag, are linked in front of the firstSMBF_LASTbug, soSMBF_LASTbugs always stay at the tail, in the order they were added.switch_core_media_bug_addrejectsSMBF_FIRST | SMBF_LASTwithSWITCH_STATUS_GENERR.switch_core_media_bug_set_flagdoes not move the bug.media_bug_last_orderingintests/unit/switch_ivr_async.cpins down the ordering together withSMBF_FIRST.Validation
fs-imagerunsswitch_ivr_asyncin itsunit-teststage, so it will cover the new test once it builds from this fork instead ofsignalwire/freeswitchv1.11.3.Known gaps
src/mod/languages/mod_managed/managed/swig.cshas not been regenerated, soSMBF_LASTis missing from the C# bindings.Note
This was created with AI assistance.