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

Fixed WebRTC AEC3 alignment issue on Linux ARMv7 #4228

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion pjmedia/src/pjmedia/echo_webrtc_aec3.cpp
Copy link
Contributor

Choose a reason for hiding this comment

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

When looking through this file, except new/delete, is is pure C code. What do you think about changing new/delete to malloc/free and renaming the file to pjmedia/src/pjmedia/echo_webrtc_aec3.c?

Copy link
Member Author

Choose a reason for hiding this comment

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

Webrtc AEC3 is actually C++, even the compilation process specifically require -std=c++17.

Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ PJ_DEF(pj_status_t) webrtc_aec3_create(pj_pool_t *pool,
webrtc_ec *echo;

*p_echo = NULL;


#if WEBRTC_LINUX == 1 && defined(WEBRTC_ARCH_ARM_V7)
/* Workaround to fix alignment trap issue on Linux ARMv7 machine. */
echo = new webrtc_ec();
#else
echo = PJ_POOL_ZALLOC_T(pool, webrtc_ec);
#endif
PJ_ASSERT_RETURN(echo != NULL, PJ_ENOMEM);

if (clock_rate != 16000 && clock_rate != 32000 && clock_rate != 48000) {
Expand Down Expand Up @@ -152,6 +157,10 @@ PJ_DEF(pj_status_t) webrtc_aec3_destroy(void *state )
echo->rend_buf = NULL;
}

#if WEBRTC_LINUX == 1 && defined(WEBRTC_ARCH_ARM_V7)
delete echo;
#endif

return PJ_SUCCESS;
}

Expand Down
Loading