@@ -1096,7 +1096,7 @@ int rtcAddTrackEx(int pc, const rtcTrackInit *init) {
10961096 case RTC_CODEC_OPUS:
10971097 case RTC_CODEC_PCMU:
10981098 case RTC_CODEC_PCMA:
1099- case RTC_CODEC_AAC:
1099+ case RTC_CODEC_AAC:
11001100 case RTC_CODEC_G722: {
11011101 auto audio = std::make_unique<Description::Audio>(mid, direction);
11021102 switch (init->codec ) {
@@ -1687,28 +1687,11 @@ int rtcGetWebSocketServerPort(int wsserver) {
16871687
16881688#endif
16891689
1690- void rtcPreload () {
1691- try {
1692- rtc::Preload ();
1693- } catch (const std::exception &e) {
1694- PLOG_ERROR << e.what ();
1695- }
1696- }
1697-
1698- void rtcCleanup () {
1699- try {
1700- size_t count = eraseAll ();
1701- if (count != 0 ) {
1702- PLOG_INFO << count << " objects were not properly destroyed before cleanup" ;
1703- }
1704-
1705- if (rtc::Cleanup ().wait_for (10s) == std::future_status::timeout)
1706- throw std::runtime_error (
1707- " Cleanup timeout (possible deadlock or undestructible object)" );
1708-
1709- } catch (const std::exception &e) {
1710- PLOG_ERROR << e.what ();
1711- }
1690+ int rtcSetThreadPoolSize (unsigned int count) {
1691+ return wrap ([&] {
1692+ SetThreadPoolSize (count);
1693+ return RTC_ERR_SUCCESS;
1694+ });
17121695}
17131696
17141697int rtcSetSctpSettings (const rtcSctpSettings *settings) {
@@ -1759,3 +1742,28 @@ int rtcSetSctpSettings(const rtcSctpSettings *settings) {
17591742 return RTC_ERR_SUCCESS;
17601743 });
17611744}
1745+
1746+ void rtcPreload () {
1747+ try {
1748+ rtc::Preload ();
1749+ } catch (const std::exception &e) {
1750+ PLOG_ERROR << e.what ();
1751+ }
1752+ }
1753+
1754+ void rtcCleanup () {
1755+ try {
1756+ size_t count = eraseAll ();
1757+ if (count != 0 ) {
1758+ PLOG_INFO << count << " objects were not properly destroyed before cleanup" ;
1759+ }
1760+
1761+ if (rtc::Cleanup ().wait_for (10s) == std::future_status::timeout)
1762+ throw std::runtime_error (
1763+ " Cleanup timeout (possible deadlock or undestructible object)" );
1764+
1765+ } catch (const std::exception &e) {
1766+ PLOG_ERROR << e.what ();
1767+ }
1768+ }
1769+
0 commit comments